Skip to content
Prev 171391 / 398506 Next

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

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:

df$col <- as.numeric(as.character(df$col))
On Mon, Feb 23, 2009 at 8:35 AM, Mao Jianfeng <jianfeng.mao at gmail.com> wrote: