Description Usage Arguments Value Examples
View source: R/check-annotation-values.R
Check a set of keys and their values
1 2 3 4 5 6 7 8 9 10 11 | 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
)
|
x |
A data frame of annotation data |
annotations |
A data frame of annotations to check against |
whitelist_keys |
A character vector of annotation keys to whitelist. If provided, all values for the given keys will be treated as valid. |
whitelist_values |
A named list of keys (as the names) and values (as vectors) to whitelist |
success_msg |
Message indicating the check succeeded. |
fail_msg |
Message indicating the check failed. |
return_valid |
Should the function return valid values? Defaults to
|
annots_link |
Link to a definition of the annotations being used in the project |
syn |
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.
1 2 3 4 5 6 7 8 9 10 11 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.