
Last chance! 50% off unlimited learning
Sale ends in
Check a set of keys and their values
check_values(
x,
annotations,
whitelist_keys = NULL,
whitelist_values = NULL,
success_msg = "All annotation values are valid",
fail_msg = "Some annotation values are invalid",
return_valid = FALSE,
annots_link = "https://shinypro.synapse.org/users/nsanati/annotationUI/",
syn
)
A data frame of annotation data
A data frame of annotations to check against
A character vector of annotation keys to whitelist. If provided, all values for the given keys will be treated as valid.
A named list of keys (as the names) and values (as vectors) to whitelist
Message indicating the check succeeded.
Message indicating the check failed.
Should the function return valid values? Defaults to
FALSE
(i.e. the function will return invalid values).
Link to a definition of the annotations being used in the project
Synapse client object
If return_valid = FALSE
: a condition object indicating whether all
annotation values are valid. Invalid annotation values are included as data
within the object: a named list where each element corresponds to a key
that contains invalid values, and the contents of each element is a vector
of invalid values. If return_valid = TRUE
: a named list of the valid
annotation keys and values.
# NOT RUN {
annots <- data.frame(
key = c("fileFormat", "fileFormat"),
value = c("txt", "csv"),
columnType = c("STRING", "STRING"),
stringsAsFactors = FALSE
)
dat <- data.frame(
fileFormat = c("wrong", "txt", "csv", "wrong again"),
stringsAsFactors = FALSE
)
check_values(dat, annots)
# }
Run the code above in your browser using DataLab