Load naturalistic data stored in .csv files
nds_load_data.RdThis function loads one or more .csv files containing the NDS-BR data.
Arguments
- pattern
A
characterobject with a common initial text among the files to be read.- folder
A
characterobject of the path to the folder containing the files.- sep
A
characterobject defining the separator in the.csvfile. Default is ";".- vars
A
charactervector of variable names to load. If empty, all variables are loaded.
Details
nds_load_data default considers that data inside the .csv files
are separated by ';', and decimals are expressed by comma (','). If
sep is set to ",", decimals must be expressed by ".". The
pattern argument is used to identify a common initial text among the
files. If only one file is to be loaded, pattern can be the full name
of the file. In the folder argument it is possible to insert a path
of the folder in which the files are included. If this field is left empty,
the function considers that the files are present in the working directory
of the project (getwd()). In the vars parameter it is possible
to insert a character vector with the desired variable names to load.
Examples
## Considering driver_A.csv, driver_B.csv and driver_C.csv:
path <- system.file("extdata", package = "ndsbr")
df <- nds_load_data("driver", path)
#> ℹ Using "','" as decimal and "'.'" as grouping mark. Use `read_delim()` for more control.
#> ℹ Using "','" as decimal and "'.'" as grouping mark. Use `read_delim()` for more control.
#> ℹ Using "','" as decimal and "'.'" as grouping mark. Use `read_delim()` for more control.