tsvGetData: Read matching lines from a tsv file, using a pre-computed...

Description Usage Arguments Details Value See Also Examples

Description

This function reads lines that match the given patterns from a TSV file with the assistance of a pre-computed index file to the start of each row.

Usage

1
2
tsvGetData(filename, indexfile, rowpatterns, colpatterns, dtype = "",
  findany = TRUE)

Arguments

filename

The name (and path) of the file containing the data to index.

indexfile

The name (and path) of the file to which the index will be written.

rowpatterns

A vector of strings containing the string to match against the index entries. Only lines with keys that exactly match at least one pattern string are returned.

colpatterns

A vector of strings to match against the column headers in the first row

dtype

A prototype element that specifies by example the type of matrix to return. The value of the parameter is ignored. Accepted types are string (default), numeric (float), and integer.

findany

If false, all patterns must be matched. If true (default) at least one pattern must match.

Details

The index file must have been created by tsvGenIndex and the data file must not have changed since the index file was created.

Value

A matrix containing one row for each matched line and one column for each matched column.

See Also

tsvGenIndex

Examples

1
2
3
4
## Not run: 
tab <- tsvGetData ("data.tsv", "index.tsv", c("pattern1", "pattern2"), c('cpat1'))

## End(Not run)

bmbroom/tsvio documentation built on June 5, 2021, 2:31 a.m.