get_bad_ct {metatools} | R Documentation |
Gets vector of control terminology which should be there
Description
This function checks the column in the dataset only contains the control terminology as defined by the metacore specification. It will return all values not found in the control terminology
Usage
get_bad_ct(data, metacore, var, na_acceptable = NULL)
Arguments
data |
Data to check |
metacore |
A metacore object to get the codelist from. If the variable
has different codelists for different datasets the metacore object will
need to be subsetted using |
var |
Name of variable to check |
na_acceptable |
Logical value, set to |
Value
vector
Examples
library(haven)
library(metacore)
library(magrittr)
load(metacore_example("pilot_ADaM.rda"))
spec <- metacore %>% select_dataset("ADSL")
data <- read_xpt(metatools_example("adsl.xpt"))
get_bad_ct(data, spec, "DCSREAS")
get_bad_ct(data, spec, "DCSREAS", na_acceptable = FALSE)
[Package metatools version 0.2.0 Index]