[R] how todefine an variable/column in a dataframe as numeric mode

2009-02-23 Thread Mao Jianfeng
Hello dear R-users, I have a tricky problem of data manipulation with R. Although it seems very easy, I can not solve it by myselves. The problem is a variable in my dataset is usually be readed as factor (variable mode), however I want it be a numeric one. I want to know how can I define an

Re: [R] how todefine an variable/column in a dataframe as numeric mode

2009-02-23 Thread jim holtman
First of all when read in you can define the class of each column. It sounds like you have a non-numeric in that column. If you are not using factors, then putting 'as.is=TRUE' will make sure that they are read in as characters. If you want to convert a column to numeric, do the following: