Reads data from a file path (either csv of json file), and optionally from another csv file (with camera data).
Usage
read_data(
path_rec,
sep_rec,
path_cam = NULL,
sep_cam = NULL,
NA_strings = c("NA", ""),
add_rowid = FALSE
)Arguments
- path_rec
A valid file path for records.
- sep_rec
separator used for the records.
- path_cam
A valid file path for cameras (defaults to
NULL).- sep_cam
separator used for the cameras (defaults to
NULL).- NA_strings
Vector of characters that should be considered
NAafter import- add_rowid
Should row IDs be added to the observations df? If yes, row names in the form of "ID_xx" are added to the the dataframe.
Value
A list with one component or a datapackage object.
if
path_recis a json file, returns adatapackageobject (inheriting list). The data is in the$dataslot, which is a list with 2 components:$deployments(cameras)$observations(records)
if
path_recis a csv file, returns a list with one component named$data, which is a list with 2 components:$deployments(cameras: if no camera file was provided inpath_cam, it isNULL)$observations(records)
