Checks that every tag supplied in ... obeys syntactic and value rules.
Returns the cleaned list of tags if all checks pass.
Usage
dl_check_tags(
...,
single = TRUE,
na_allowed = FALSE,
null_allowed = FALSE,
tag_value_pattern = "^[A-Za-z0-9_.-]+( [A-Za-z0-9_.-]+)*$",
verbose = FALSE
)Arguments
- ...
Named tag arguments (
tag = value).waveA character vector specifying the waves to filter on.typeA character vector specifying the types to filter on.nameA character vector specifying the names to filter on.versionA character vector specifying the versions to filter on.batchA character vector specifying the batches to filter on.sourceA character vector specifying the sources to filter on.
- single
Logical. If
TRUE, each tag must be a scalar (length = 1). IfFALSE, tag values may be character vectors. Default isTRUE.- na_allowed
Logical. If
FALSE, no tag value may containNA.- null_allowed
Logical. If
FALSE, no tag value may beNULL.- tag_value_pattern
Regular expression that tag values must match. Defaults to
^[A-Za-z0-9_.-]+( [A-Za-z0-9_.-]+)*$(letters, digits, underscore, hyphen, dot, and single internal spaces). Leading, trailing, and consecutive spaces stay forbidden: they are invisible in listings and S3 clients can mangle them./and=stay forbidden because they are structural in datalake keys.- verbose
Logical. If
TRUE, prints messages about the validation process. Default isFALSE.
Examples
dl_check_tags(wave = "a", type = "raw")
dl_check_tags(wave = "Old Tracker")
dl_check_tags(batch = "1", version = "v2")
dl_check_tags(batch = "1", version = c("v1", "v2"), single = FALSE)
dl_check_tags(wave = NULL, null_allowed = TRUE)