[R] how to convert all columns of a data frame into factors
Gabor Grothendieck
ggrothendieck at gmail.com
Wed Oct 4 17:44:36 CEST 2006
Try this:
replace(BOD, TRUE, lapply(BOD, factor))
On 10/4/06, Weiwei Shi <helprhelp at gmail.com> wrote:
> Hi,
>
> I use "apply"
> apply(x, 2, factor)
>
> but it does not work. please help. thanks.
>
> --
> Weiwei Shi, Ph.D
> Research Scientist
> GeneGO, Inc.
>
> "Did you always know?"
> "No, I did not. But I believed..."
> ---Matrix III
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>
More information about the R-help
mailing list