rcsvdplyrreader

Reading multiple csv files in R while specifying column type


I am using this code to read in muptiple csv files in r from a folder.

temp = list.files(pattern="*.csv")
myfiles = lapply(temp, read.delim)

I want to specify the column types while doing this step. How is this possible? Thanks


Solution

  • myfiles = lapply(temp, read.delim, colClasses = a_vector_of_col_classes)