I added spaces around my fields in CSV file in Vim csv.vim plugin. Now, I am having difficulties in declaring the column classes as numerical (num etc). Having negative values there also cause problems in the following columnsThe data can have empty fields. Data data.csvTest, test2, test3    , 1    , 110.8, -1   , 11.1 , 2    , 2Codelibrary('methods')DF <- read.csv(/home/masi/Data/data.csv, header = T, sep = ,, colClasses=c('num','num'))DFOutputError in methods::as(data[[i]], colClasses[i]) :   no method or default for coercing character to numCalls: read.csv -> read.table -> <Anonymous>Execution haltedCasting to numerical fails  when doing colClasses=c('num','num').Output in Column 3 is considered as NA because of one minus mark (-1) in the second column. R: 3.3.3    
How to declare this R CSV data as numerical?
csv;r
AFAIK num is not a valid atomic vector class in R:Possible values are NA (the default, when type.convert is used),  NULL (when the column is skipped), one of the atomic vector classes  (logical, integer, numeric, complex, character, raw), or factor,  Date or POSIXct. Otherwise there needs to be an as method (from  package methods) for conversion from character to the specified  formal class.Your code should work if you replace it by numeric:> DF <- read.csv(data.csv, header = T, sep = ,, colClasses=c('num','num'))Error in methods::as(data[[i]], colClasses[i]) :   no method or default for coercing character to numwhereas> DF <- read.csv(data.csv, header = T, sep = ,, colClasses=c('numeric','numeric'))> > DF  Test test2 test31   NA     1     12 10.8    -1     13  1.1     2     2> 