Learn R Programming

wrMisc (version 1.7.0)

readTabulatedBatch: Btach 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

Description

Btach 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

Usage

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
)

Arguments

query

(character) vector of file-names to be read, if "." all files will be read (no matter what their extension might be)

path

(character) path for reading files, if NULL or NA the current directory will be used

dec

(character, length=1) decimals to use, will be passed to fread or read.delim

header

(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

strip.white

(logical, length=1) Strips leading and trailing whitespaces of unquoted fields, will be passed to fread or read.delim

blank.lines.skip

(logical, length=1) If TRUE blank lines in the input are ignored. will be passed to fread or read.delim

fill

(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

filtCol

(integer, length=1) which columns should be used for filtering, if NULL or NA all data will be returned

filterAsInf

(logical, length=1) filter as inferior or equal (TRUE) or superior or equal threshold filtVal

filtVal

(numeric, length=1) which numeric threshold should be used for filtering, if NULL or NA all data will be returned

silent

(logical) suppress messages

callFrom

(character) allow easier tracking of message(s) produced

debug

(logical) display additional messages for debugging

Value

list of data.frames

See Also

fread, read.delim, for reading csv : readCsvBatch

Examples

Run this code
# 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