Skip to contents

Verify if a Dataset Has the Required Format as Queries Dataset.

Usage

assert_valid_queries(queries, queries_name)

Arguments

queries

A data.frame.

queries_name

Name of the queries dataset, a string.

Value

The function throws an error if any of the requirements not met.

Details

Check if the dataset has the following columns

  • PREFIX, e.g., SMQ01, CQ12

  • GRPNAME, non NA, must be unique per each PREFIX

  • GRPID, could be NA, must be unique per each PREFIX

  • SCOPE, 'BROAD', 'NARROW', or NA

  • SCOPEN, 1, 2, or NA

  • SRCVAR, e.g., "AEDECOD", "AELLT", "AELLTCD", ...

  • TERMNAME, character, could be NA only at those observations where TERMID is non-NA

  • TERMID, integer, could be NA only at those observations where TERMNAME is non-NA

Examples

data("queries")
assert_valid_queries(queries, "queries")