Closed MarthaZillig closed 7 years ago
When you import using read.csv
, you may want to add the argument stringsAsFactors=FALSE
. It will then treat your data as "character", and you can try using the as.numeric() function to convert to numeric. However, if you have a few different data classes in the same column it might cause trouble, also as.integer()
can round things whereas as.numeric()
will not.
I'm working with my own data, and after I imported the csv I realized r was treating one of my variables like a factor instead of numeric. Using the function as.interger just changes my data to the factor levels that r assigned. How do I get around this??