Asserts the specified vars are present in the supplied referendum data. Depending on vars, additional integrity checks are performed.
Arguments
- data
RDB referendum data as returned by
rfrnds().- vars
Names of the variables to check. A character vector.
See also
Other referendum data functions:
add_rfrnds(),
count_rfrnds(),
delete_rfrnds(),
download_file_attachment(),
edit_rfrnds(),
rfrnd(),
rfrnd_exists(),
rfrnds(),
rfrnds_bkp(),
validate_rfrnds()
Examples
rdb::rfrnd(id = "5bbbe26a92a21351232dd73f") |> rdb::assert_vars(vars = "country_code")
try(
tibble::tibble(country_code = "AN") |> rdb::assert_vars(vars = "country_code")
)
#> Error in map(.x, .f, ..., .progress = .progress) :
#> ℹ In index: 1.
#> Caused by error in `assert_content()`:
#> ! Assertion on `data$country_code` failed: The following country codes have been deleted from ISO 3166-1 and were moved to ISO 3166-3 (former countries)
#> instead: "AN"