[R] how to force years as.numeric?

Viktor Nagy viktor.nagy at gmail.com
Thu Dec 11 01:54:21 CET 2008


Hi,

My next problem is that I have a data frame with an years column. This
column for some reason is recognised as factor instead of being
numeric. The years go from 1970 to 2007. When I convert it to numeric
with as.numeric then it goes from 1 to 38. Is there a way to convert
it with saving its "levels"?

This would be actually important as I am affraid of converting my real
values that are recognised as factors as well.

Thanks, Viktor



More information about the R-help mailing list