[R] converting to factor

R. Sean Bowman sean at rootnode.com
Tue Apr 22 23:14:28 CEST 2003


hello,

I have a list of numbers that I want to convert into factors representing
ranges of values.  For example, if I have

c(2.5, 1.6, 3.2)

I might want a list of factors like

c("<3", "<3", ">3")

I think I can do this by writing a function and using apply, as.matrix,
&c., but I'm looking for a nicer way.  Any help is greatly appreciated.

Thanks!
Sean



More information about the R-help mailing list