[R] Creating Hmisc labels inside a function

Steve Powell steve at promente.org
Tue Sep 11 11:01:32 CEST 2007


hello list members,
I am wanting to write a label using the Hmisc package, but inside a
function. Normally I can do:

library(Hmisc)
M=2
label(M)="lab"

#But inside a function the "=" does not work:
Test=function(obj,labe)
{
label(obj)=labe
}

Test(M,"new label")

I usually use the "assign" function to make assignments inside functions,
but assign will not work with attributes, labels etc.
Any ideas?
Thanks in advance

Steve Powell

 
proMENTE social research 
research | evaluation | training & consulting 
Kranjčevićeva 35, 71000 Sarajevo 
mobile: +387 61 215 997 | office: +387 33 556 865 | fax: +387 33 556 866
skype: stevepowell99 
www.promente.org  |  www.mojakarijera.com  |  www.psih.org  


Checked by AVG Free Edition. 

17:43



More information about the R-help mailing list