Re: [R] Converting text to numbers

From: David Barron <>
Date: Wed 27 Sep 2006 - 21:28:37 GMT

> Then, I tried to convert them to numbers using the following.
> > Sample1$FCT2 <- as.numeric(Sample1$FCT2)
> > Sample1$OBS2 <- as.numeric(Sample1$OBS2)

This is actually an FAQ. Do the following and it should be fine:

> Sample1$FCT2 <- as.numeric(as.character(Sample1$FCT2))
> Sample1$OBS2 <- as.numeric(as.character(Sample1$OBS2))

David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu Sep 28 07:33:28 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 27 Sep 2006 - 22:30:07 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.