check_variables | R Documentation |
This function checks the variables in the dataset against the variables defined in the metacore specifications. If everything matches the function will print a message stating everything is as expected. If there are additional or missing variables an error will explain the discrepancies
check_variables(data, metacore, dataset_name = deprecated(), strict = TRUE)
message if the dataset matches the specification and the dataset, and error otherwise
library(haven)
library(metacore)
library(magrittr)
load(metacore_example("pilot_ADaM.rda"))
spec <- metacore %>% select_dataset("ADSL")
data <- read_xpt(metatools_example("adsl.xpt"))
check_variables(data, spec)
data["DUMMY_COL"] <- NA
check_variables(data, spec, strict = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.