I am trying to specify the colClasses
options in the read.csv
function in R. In my data, the first column \"time\" is basically a character vector
I know OP asked about the utils::read.csv
function, but let me provide an answer for these that come here searching how to do it using readr::read_csv
from the tidyverse.
read_csv ("test.csv", col_names=FALSE, col_types = cols (.default = "c", time = "i"))
This should set the default type for all columns as character, while time would be parsed as integer.