data.table
isBtach reading of tabulated (text-) files
This function allows batch reading of tabulated text files. The files can be designed specifically, alternatively all files from a given directory can be read.
If package data.table
is
readTabulatedBatch(
query,
path,
dec = ".",
header = "auto",
strip.white = FALSE,
blank.lines.skip = TRUE,
fill = FALSE,
filtCol = 2,
filterAsInf = TRUE,
filtVal = 5000,
silent = FALSE,
callFrom = NULL,
debug = FALSE
)
(character) vector of file-names to be read, if "."
all files will be read (no matter what their extension might be)
(character) path for reading files, if NULL
or NA
the current directory will be used
(character, length=1) decimals to use, will be passed to fread
or read.delim
(character, length=1) path for reading files, if NULL
or NA
the current directory will be used, will be passed to fread
or read.delim
(logical, length=1) Strips leading and trailing whitespaces of unquoted fields, will be passed to fread
or read.delim
(logical, length=1) If TRUE
blank lines in the input are ignored. will be passed to fread
or read.delim
(logical, length=1) If TRUE
then in case the rows have unequal length, blank fields are implicitly filled, will be passed to fread
or read.delim
(integer, length=1) which columns should be used for filtering, if NULL
or NA
all data will be returned
(logical, length=1) filter as inferior or equal (TRUE
) or superior or equal threshold filtVal
(numeric, length=1) which numeric threshold should be used for filtering, if NULL
or NA
all data will be returned
(logical) suppress messages
(character) allow easier tracking of message(s) produced
(logical) display additional messages for debugging
list of data.frames
fread
, read.delim
, for reading csv : readCsvBatch
# NOT RUN {
path1 <- system.file("extdata", package="wrMisc")
fiNa <- c("a1.txt","a2.txt")
allTxt <- readTabulatedBatch(fiNa, path1)
str(allTxt)
# }
Run the code above in your browser using DataLab