load.data.file: Loads data from a CSV file

Description Usage Arguments Value Examples

Description

This function loads data from the given CSV file and it adds some extra data coming from the fields in the file name. The number of capture groups in the regular expression (pattern) must match the number of fields.

Usage

1
load.data.file(fname, pattern, fields, custom.func = NULL, ...)

Arguments

fname

CSV file name.

pattern

Regular expression used to extract the fields values.

fields

Fields that uniquely identify the data from a CSV file.

custom.func

Function for post-processing the data. Defaults to NULL.

...

Arguments to pass to data.table::fread().

Value

A data.table object containing the data read from the CSV file.

Examples

1
2
3
4
5
6
## Not run: 
load.data.file('results-1-simple.csv',
               'results-(\\d+)-(\\w+)\\.csv',
               c('ID', 'config'))

## End(Not run)

betabandido/exptools documentation built on May 12, 2019, 7:25 p.m.