On Apr 29, 2010, at 1:42 PM, Henrique Dallazuanna wrote:



On Thu, Apr 29, 2010 at 12:05 PM, David Winsemius <dwinsem...@comcast.net > wrote:

snipped



##Then bind to your data
z <- cbind(y,x)

Oooh. Not a good practice, at least for the newish useR. cbind and rbind create matrices and as a consequence coerce all of their elements to be of the same type. Numeric columns would become character vectors. Not generally a desired result. This would be safer:


X is a data.frame, so, the object created is a data.frame.

Thank you for the correction. I probably read at one time that there was a cbind.data.frame method but I obviously forgot that point. Good to know.


dat.I$ID2.cf  <- as.character( factor(dat.ID$ID2, labels = 1:7)  )
--
David.


Thanks again, I expected it to be more complicated!

Cheers,

Ross



David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to