简体   繁体   English

在指定列类型时读取 R 中的多个 csv 文件

[英]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.我正在使用此代码从文件夹中读取 r 中的多个 csv 文件。

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谢谢

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM