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_NAME
column expected?- expect_query_id
Is the
QUERY_ID
column expected?- source_text
Text describing the source of the terms, e.g.,
"the data frame provided for the
definitionelement"
.
Value
An error is issued if
terms
is not a data frame,terms
has zero observations,the
TERM_LEVEL
variable is not interms
,neither the
TERM_NAME
nor theTERM_ID
variable is interms
,expect_query_name == TRUE
and theQUERY_NAME
variable is not interms
,expect_query_id == TRUE
and theQUERY_ID
variable 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`.