Ah ha! That's perfect. It would have taken me forever to get that. And I'm
back in business....

Thanks,
Jeff.


----- Original Message ----- 
From: "Dieter Menne" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; "R-Help"
<[EMAIL PROTECTED]>
Sent: Sunday, November 16, 2003 10:23 AM
Subject: prevent conversion to factors in aggregate?


> 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