Establishes a new data source project, used to collect and prepare data from a new source.
Usage
dcf_add_source(name, project_dir = ".", open_after = interactive())
Project
Within a source project, there are two files to edits:
ingest.R
: This is the primary script, which is automatically rerun. It should store raw data and resources inraw/
where possible, then use what's inraw/
to produce standard-format files instandard/
. This file is sourced from its location during processing, so any system paths must be relative to itself.measure_info.json
: This is where you can record information about the variables included in the standardized data files. Seedcf_measure_info
.
Examples
project_dir <- paste0(tempdir(), "/temp_project")
dcf_init("temp_project", dirname(project_dir))
dcf_add_source("source_name", project_dir)
list.files(paste0(project_dir, "/data/source_name"))
#> [1] "README.md" "ingest.R" "measure_info.json"
#> [4] "process.json" "project.Rproj" "raw"
#> [7] "standard"