View source: R/readTabulatedBatch.R
readTabulatedBatch | R Documentation |
This function allows batch reading of multiple tabulated text files n batch.
The files can be designed specifically, or, alternatively all files from a given directory can be read.
If package data.table is available, faster reading of files will be performed using the function fread
.
readTabulatedBatch(
query,
path = NULL,
dec = ".",
header = "auto",
strip.white = FALSE,
blank.lines.skip = TRUE,
fill = FALSE,
filtCol = 2,
filterAsInf = TRUE,
filtVal = 5000,
silent = FALSE,
callFrom = NULL,
debug = FALSE
)
query |
(character) vector of file-names to be read, if |
path |
(character) path for reading files, if |
dec |
(character, length=1) decimals to use, will be passed to |
header |
(character, length=1) path for reading files, if |
strip.white |
(logical, length=1) Strips leading and trailing whitespaces of unquoted fields, will be passed to |
blank.lines.skip |
(logical, length=1) If |
fill |
(logical, length=1) If |
filtCol |
(integer, length=1) which columns should be used for filtering, if |
filterAsInf |
(logical, length=1) filter as inferior or equal ( |
filtVal |
(numeric, length=1) which numeric threshold should be used for filtering, if |
silent |
(logical) suppress messages |
callFrom |
(character) allow easier tracking of messages produced |
debug |
(logical) display additional messages for debugging |
If you want to provide a flexible pattern of ffile-names, this has to be done before calling this usntion, eg using grep
to provide an explicit collection of flles.
However, it is possible to read different files from different locations/directories, the length of path
must match the length of query
This function returns a list of data.frames
fread
, read.delim
, for reading batch of csv files : readCsvBatch
path1 <- system.file("extdata", package="wrMisc")
fiNa <- c("a1.txt","a2.txt")
allTxt <- readTabulatedBatch(fiNa, path1)
str(allTxt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.