assert_terms {admiral} | R Documentation |
The function checks the requirements for terms for queries provided by the user. The terms could have been provided directly in the query definition or via a user provided function for accessing a SMQ or SDG database.
assert_terms(terms, expect_grpname = FALSE, expect_grpid = FALSE, source_text)
terms |
Terms provided by user |
expect_grpname |
Is the |
expect_grpid |
Is the |
source_text |
Text describing the source of the terms, e.g., |
An error is issued if
terms
is not a data frame,
terms
has zero observations,
the SRCVAR
variable is not in terms
,
neither the TERMNAME
nor the TERMID
variable is in terms
,
expect_grpname == TRUE
and the GRPNAME
variable is not in terms
,
expect_grpid == TRUE
and the GRPID
variable is not in terms
,
Other Advanced Functions:
assert_db_requirements()
,
assert_valid_queries()
,
extend_source_datasets()
,
filter_date_sources()
,
format.basket_select()
,
list_tte_source_objects()
,
params()
,
validate_basket_select()
,
validate_query()
try(
assert_terms(
terms = 42,
source_text = "object provided by the `definition` element"
)
)