I am trying to read a CSV file that has barcodes in the first column, but when R gets it into a data.frame, it converts 1665535004661
to 1.67E+12
.<
Since you are not performing arithmetic on this value, character is appropriate. You can use the colClasses argument to set various classes for each column, which is probably better than using all character.
data.csv:
a,b,c
1001002003003004,2,3
Read character, then integers:
x <- read.csv('test.csv',colClasses=c('character','integer','integer'))
x
a b c
1 1001002003003004 2 3
mode(x$a)
[1] "character"
mode(x$b)
[1] "numeric"