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.
Arguments
- terms
Terms provided by user
- expect_query_name
Is the
QUERY_NAMEcolumn expected?- expect_query_id
Is the
QUERY_IDcolumn expected?- source_text
Text describing the source of the terms, e.g.,
"the data frame provided for thedefinitionelement".
Value
An error is issued if
termsis not a data frame,termshas zero observations,the
TERM_LEVELvariable is not interms,neither the
TERM_NAMEnor theTERM_IDvariable is interms,expect_query_name == TRUEand theQUERY_NAMEvariable is not interms,expect_query_id == TRUEand theQUERY_IDvariable is not interms,
See also
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()
Examples
try(
assert_terms(
terms = 42,
source_text = "object provided by the `definition` element"
)
)
#> Error in assert_terms(terms = 42, source_text = "object provided by the `definition` element") :
#> object provided by the `definition` element is not a data frame but `42`.
