Skip to contents

Adds one dataset and safely rewrites the YAML file after validating the complete configuration against the schema and source requirements reported by the installed datum executable.

Usage

datum_dataset_add(
  id,
  desc,
  target,
  source = NULL,
  sources = NULL,
  policy = NULL,
  config = ".data.yaml",
  executable = NULL,
  wd = NULL,
  timeout = getOption("datur.timeout", 300),
  ignore = NULL
)

Arguments

id

Unique dataset identifier.

desc

Human-readable description.

target

Local target path.

source

One source created with datum_source() or an equivalent named list.

sources

A non-empty list of fallback sources. Supply exactly one of source and sources.

policy

Optional "fail", "update", or "log" override.

config

Configuration path. A missing file is created with version 1.

executable

Optional explicit executable path.

wd

Optional child-process working directory.

timeout

Positive finite timeout in seconds.

ignore

Optional logical override for datum 1.6.0's VCS ignore management.

Value

Invisibly, the normalized configuration path.

Examples

if (FALSE) { # \dontrun{
datum_dataset_add(
  "rates", "Daily exchange rates", "data/rates.csv",
  source = datum_source("http", url = "https://example.test/rates.csv")
)
} # }