I am using readbulk::read_bulk()
to load several (~40+) .dat files into R. I was able to successfully load in another set of .dat files that used ,
as delimiters, but I was unable to do it for a set of files that used |
as delimiters. How can I load these files and separate the data into columns given the |
delimiter? Or, how can I separate the loaded data.frame by the |
delimiter?
Example:
TEMP <- read_bulk(directory = "C:/Users/ABC/Desktop/Dat Files")
This produces a TEMP
file with 19799 obs of 3 variables. As such, it is not separating them out by the |
delimiter.
I've also tried:
files <- list.files(path = "C:/Users/ABC/Desktop/Dat Files2", pattern = "*.dat")
TEMP <- read_bulk(directory = "C:/Users/ABC/Desktop/Dat Files2", fun = utils::read.csv(file = files, sep = "\\|"))
But I get:
Error in file(file, "rt") : invalid 'description' argument