View source: R/check-col-names.R
| check_col_names | R Documentation |
Check column names against their corresponding template
check_col_names( data, template, success_msg = NULL, fail_msg = NULL, behavior = NULL ) check_cols_manifest( data, id, success_msg = "All manifest columns present", fail_msg = "Missing columns in the manifest", ... ) check_cols_individual( data, id, success_msg = "All individual metadata column names present", fail_msg = "Missing columns in the individual metadata file", ... ) check_cols_assay( data, id, success_msg = "All assay metadata column names present", fail_msg = "Missing columns in the assay metadata file", ... ) check_cols_biospecimen( data, id, success_msg = "All biospecimen column names present", fail_msg = "Missing columns in the biospecimen metadata file", ... )
data |
Data frame to check against template (manifest, individual metadata, or assay metadata) |
template |
Character vector of column names from the template to check against |
success_msg |
Message indicating the check succeeded. |
fail_msg |
Message indicating the check failed. |
behavior |
The intended behavior of the test |
id |
Synapse ID of the template to check against |
... |
Additional arguments passed to syn$get() |
A condition object indicating whether the required columns were
present ("check_pass") or absent ("check_fail").
get_template()
template <- c("individualID", "specimenID", "assay")
dat <- data.frame(individualID = c("a", "b"), specimenID = c("a1", "b1"))
check_col_names(dat, template)
## Not run:
syn <- synapse$Synapse()
syn$login()
a <- data.frame(path = "/path/file.txt", parent = "syn123", assay = "rnaSeq")
check_cols_manifest(a, syn)
b <- data.frame(assay = "rnaSeq")
check_cols_manifest(b, syn)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.