setup_src_data: Data setup

Description Usage Arguments Details Value

View source: R/setup-attach.R


Making a dataset available to ricu consists of 3 steps: downloading (download_src()), importing (import_src()) and attaching (attach_src()). While downloading and importing are one-time procedures, attaching of the dataset is repeated every time the package is loaded. Briefly, downloading loads the raw dataset from the internet (most likely in .csv format), importing consists of some preprocessing to make the data available more efficiently and attaching sets up the data for use by the package. The download and import steps can be combined using setup_src_data().





Object specifying the source configuration


Forwarded to load_src_cfg() if x is a character vector


If setup_src_data() is called on data sources that have all data available with force = FALSE, nothing happens apart of a message being displayed. If only a subset of tables is missing, only these tables are downloaded (whenever possible) and imported. Passing force = TRUE attempts to re- download and import the entire data set. If the data source is available as a data package (as is the case for the two demo datasets), data is not downloaded and imported, but this package is installed.

In most scenarios, setup_src_data() does not need to be called by users, as upon package loading, all configured data sources are set up in a way that enables download of missing data upon first access (and barring user consent). However, instead of accessing all data sources where data missingness should be resolved one by one, setup_src_data() is exported for convenience.


Called for side effects and returns NULL invisibly.

ricu documentation built on May 20, 2021, 1:05 a.m.