Re: [R] avoid losing data.frame attributes on cbind()

2013-04-19 Thread Liviu Andronic
] avoid losing data.frame attributes on cbind() HI, Not sure if this helps: library(plyr) res-mutate(Xa,var1=round(Sepal.Length),var2=round(Sepal.Width)) str(res) #'data.frame':150 obs. of 7 variables: # $ Sepal.Length: num 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ... # $ Sepal.Width : num 3.5

Re: [R] avoid losing data.frame attributes on cbind()

2013-04-19 Thread arun
3 3 3 4 4 3 3 3 3 ... # - attr(*, label)= chr Some df label A.K. - Original Message - From: Liviu Andronic landronim...@gmail.com To: arun smartpink...@yahoo.com Cc: R help r-help@r-project.org Sent: Friday, April 19, 2013 8:13 AM Subject: Re: [R] avoid losing data.frame attributes

Re: [R] avoid losing data.frame attributes on cbind()

2013-04-19 Thread Liviu Andronic
A.K. - Original Message - From: Liviu Andronic landronim...@gmail.com To: arun smartpink...@yahoo.com Cc: R help r-help@r-project.org Sent: Friday, April 19, 2013 8:13 AM Subject: Re: [R] avoid losing data.frame attributes on cbind() Dear Arun, On Tue, Apr 16, 2013 at 10:45

Re: [R] avoid losing data.frame attributes on cbind()

2013-04-16 Thread arun
HI, Not sure if this helps: library(plyr) res-mutate(Xa,var1=round(Sepal.Length),var2=round(Sepal.Width)) str(res) #'data.frame':    150 obs. of  7 variables: # $ Sepal.Length: num  5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ... # $ Sepal.Width : num  3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ... # $

Re: [R] avoid losing data.frame attributes on cbind()

2013-04-16 Thread arun
... # - attr(*, label)= chr Some df label A.K. - Original Message - From: arun smartpink...@yahoo.com To: Liviu Andronic landronim...@gmail.com Cc: R help r-help@r-project.org Sent: Tuesday, April 16, 2013 2:40 PM Subject: Re: [R] avoid losing data.frame attributes on cbind() HI, Not sure

Re: [R] avoid losing data.frame attributes on cbind()

2013-04-16 Thread arun
. - Original Message - From: arun smartpink...@yahoo.com To: Liviu Andronic landronim...@gmail.com Cc: R help r-help@r-project.org Sent: Tuesday, April 16, 2013 4:45 PM Subject: Re: [R] avoid losing data.frame attributes on cbind() Hi, Another method would be: Xc- Xa  Xc$var1-NA; Xc$var2- NA Xc