Spencer Graves wrote

>>I don't know how to prevent aggregate from making factors of everything,
>>but the following shows how to cast them back into what you want:
....
> DF.$bch <- as.character(DF.$b)
> DF.$dn <- as.numeric(as.character(DF.$d))
> sapply(DF., class)
...

----
help(factor) suggests:

"To �revert� a factor f to its original numeric values,
as.numeric(levels(f))[f] is recommended and slightly more efficient than
as.numeric(as.character(f)). "

And in package Hmisc there is a function "summarize" that does not touch
non-factors.

Dieter Menne

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to