Skip to contents

Establishes a new data bundle project, used to prepare outputs from standardized datasets.

Usage

dcf_add_bundle(
  name,
  project_dir = ".",
  source_files = NULL,
  open_after = interactive()
)

Arguments

name

Name of the bundle

project_dir

Path to the Data Collection Framework project.

source_files

Character vector of paths to standard files form source projects.

open_after

Logical; if FALSE, will not open the project.

Value

Nothing; creates default files and directories.

Project

Within a bundle 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 in raw/ where possible, then use what's in raw/ to produce standard-format files in standard/. 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. See dcf_measure_info.

Examples

project_dir <- paste0(tempdir(), "/temp_project")
dcf_init("temp_project", dirname(project_dir))
dcf_add_bundle("bundle_name", project_dir)
list.files(paste0(project_dir, "/data/bundle_name"))
#> [1] "README.md"         "build.R"           "dist"             
#> [4] "measure_info.json" "process.json"      "project.Rproj"