Re: [R] Factor Madness

From: Tony Plate <tplate_at_acm.org>
Date: Tue, 18 Dec 2007 16:29:15 -0700

 From ?cbind:

Data frame methods
The cbind data frame method is just a wrapper for data.frame(..., check.names = FALSE). This means that it will split matrix columns in data frame arguments, and convert character columns to factors unless stringsAsFactors = TRUE is passed.

(I'm guessing 'spectrum' is a data.frame before the code fragment you've shown)

hope this helps,

Tony Plate

Johannes Graumann wrote:
> Why is class(spectrum[["Ion"]]) after this "factor"?
>
> spectrum <- cbind(spectrum,Ion=rep("",
> nrow(spectrum)),Deviation.AMU=rep(0.0, nrow(spectrum)))
>
> slowly going crazy ...
>
> Joh
>
> ______________________________________________
> R-help_at_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.
>



R-help_at_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. Received on Tue 18 Dec 2007 - 23:32:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 19 Dec 2007 - 01:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.