Re: [R] converting factor to numeric

2003-08-22 Thread kjetil brinchmann halvorsen
On 21 Aug 2003 at 20:40, kjetil brinchmann halvorsen wrote: After some private responses I did what I should have done at beginning, opened S Programming at page 15. It is much clearer than the FAQ, which I think is slighly misleading. Kjetil Halvorsen Hola! The R FAQ says: 7.12 How

[R] converting factor to numeric

2003-08-21 Thread kjetil brinchmann halvorsen
Hola! The R FAQ says: 7.12 How do I convert factors to numeric? It may happen that when reading numeric data into R (usually, when reading in a file), they come in as factors. If f is such a factor object, you can use as.numeric(as.character(f)) to get the numbers back. More efficient, but

Re: [R] converting factor to numeric

2003-08-21 Thread Thomas W Blackwell
Kjetil - EdadC seems to have only five levels, anyway. What are those five levels ? Are they strings which it would make sense to interpret as numeric ? as.numeric() obviously thinks they are not. - tom blackwell - u michigan medical school - ann arbor - On Thu, 21 Aug 2003, kjetil