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
- Default value
none
- expect_grpname
-
Is the
GRPNAMEcolumn expected?- Default value
FALSE
- expect_grpid
-
Is the
GRPIDcolumn expected?- Default value
FALSE
- source_text
-
Text describing the source of the terms, e.g.,
"the data frame provided for thedefinitionelement".- Default value
none
Value
An error is issued if
termsis not a data frame,termshas zero observations,the
SRCVARvariable is not interms,neither the
TERMCHARnor theTERMNUMvariable is interms,expect_grpname == TRUEand theGRPNAMEvariable is not interms,expect_grpid == TRUEand theGRPIDvariable is not interms,
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") :
#> could not find function "assert_terms"
