nds_load_data: Load naturalistic data stored in '.csv' files

View source: R/nds_load_data.R

nds_load_dataR Documentation

Load naturalistic data stored in .csv files

Description

This function loads one or more .csv files containing the NDS-BR data.

Usage

nds_load_data(pattern, folder = NULL, sep = ";", vars = NULL)

Arguments

pattern

A character object with a common initial text among the files to be read.

folder

A character object of the path to the folder containing the files.

sep

A character object defining the separator in the .csv file. Default is ";".

vars

A character vector 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.

Value

A tibble of the NDS-BR dataset.

Examples

## Considering driver_A.csv, driver_B.csv and driver_C.csv:
path <- system.file("extdata", package = "ndsbr")
df <- nds_load_data("driver", path)

pabsantos/ndsbr documentation built on June 13, 2024, 3:47 a.m.