# NOT RUN {
csvFile <- file.path(tempdir(), "iris.csv")
write.csv(iris, file = csvFile, row.names = FALSE, quote = FALSE)
myoutput <- localDiskConn(file.path(tempdir(), "irisText"), autoYes = TRUE)
a <- readTextFileByChunk(csvFile,
output = myoutput, linesPerBlock = 10,
fn = function(x, header) {
colNames <- strsplit(header, ",")[[1]]
read.csv(textConnection(paste(x, collapse = "\n")), col.names = colNames, header = FALSE)
})
a[[1]]
# }
Run the code above in your browser using DataLab