[R] as.double( factor(something) )??

Thomas Lumley tlumley at u.washington.edu
Wed Nov 19 21:40:50 CET 2003


On Wed, 19 Nov 2003, Spencer Graves wrote:

>       Have you considered the following:
>
>       > f <- factor(1:2)
>       > as.numeric(as.character(f))
>       [1] 1 2
>
>       See Venables and Ripley (2000) S Programming (Springer, p. 15).

Or see the FAQ, which makes the same point.

	-thomas




More information about the R-help mailing list