bc_meta | R Documentation |
Sample information is kept in metadata. bc_meta
is for accessing and
updating metadata in BarcodeObj
object
bc_meta(barcodeObj)
bc_meta(barcodeObj, key = NULL) <- value
## S4 method for signature 'BarcodeObj'
bc_meta(barcodeObj)
## S4 replacement method for signature 'BarcodeObj'
bc_meta(barcodeObj, key = NULL) <- value
barcodeObj |
A |
key |
A string, identifying the metadata record name to be modified. |
value |
A string vector or a data.frame. If the |
A data.frame
data(bc_obj)
# get the metadata data.frame
bc_meta(bc_obj)
# assign value to metadata by $ operation
bc_meta(bc_obj)$phenotype <- c("l", "b")
# assign value to metadata by "key" argument
bc_meta(bc_obj, key = "sample_type") <- c("l", "b")
# show the updated metadata
bc_meta(bc_obj)
# assign new data.frame to metadata
metadata <- data.frame(
sample_name <- c("test1", "test2"),
phenotype <- c("l", "b")
)
rownames(metadata) = bc_names(bc_obj)
bc_meta(bc_obj) <- metadata
###
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.