validate_tags: Checks the tags of a safeframe object

View source: R/validate_tags.R

validate_tagsR Documentation

Checks the tags of a safeframe object

Description

This function evaluates the validity of the tags of a safeframe object by checking that: i) tags are present ii) tags is a list of character or NULL values.

Usage

validate_tags(x)

Arguments

x

a safeframe object

Value

If checks pass, a safeframe object; otherwise issues an error.

See Also

validate_types() to check if tagged variables have the right classes

Examples

## create a valid safeframe
x <- cars |>
  make_safeframe(
    mph = "speed",
    distance = "dist"
  )
x

## the below issues an error as safeframe doesn't know any defaults
## note: tryCatch is only used to avoid a genuine error in the example
tryCatch(validate_safeframe(x), error = paste)

## validation requires you to specify the types directly
validate_safeframe(x,
  mph = c("integer", "numeric"),
  distance = "numeric"
)

safeframe documentation built on June 28, 2025, 1:08 a.m.