Establishes a new data source project, used to collect and prepare data from a new source.
Usage
pophive_add_source(name, base_dir = "data", 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. Seedata_measure_info
.
Examples
data_source_dir <- tempdir()
pophive_add_source("source_name", data_source_dir)
list.files(paste0(data_source_dir, "/source_name"))
#> [1] "README.md" "ingest.R" "measure_info.json"
#> [4] "project.Rproj" "raw" "standard"