I am attempting to use read.csv()
to read in a .csv
file, but three of my columns contain floating point values. R coerces these into factors, but I would like them to retain their original values so I can accurately compare them to one another. I've tried to read the documentation, but the only thing I see there is the option to set stringsasfactors = FALSE
. Then I retain the decimal places in my column elements, but they are not numbers that I can compare to one another.
For example, if my column contained the values 3.1, 4.2, 5.3, R would coerce these into factors. If I calls as.numeric()
on them, they are squashed to 3, 4, 5. How can I keep them as floating point values when I read them in?