Description Usage Arguments Details Value Examples
View source: R/scMethrix_clustering.R
Appends colData in an scMethrix object
1 | append_colData(scm = NULL, colData = NULL, name = "Data")
|
scm |
scMethrix; Input |
colData |
dataframe-like or named vector; For a dataframe-like, must contain row names that correspond with the input |
name |
string; the name of the column for named vector input. Ignored for matrix input |
Typically used for clustering. Allows additional information to be added to colData in an scMethrix object after the object creation. It does this via a left join on the original colData. Any samples not included in the colData object will be filled with NAs.
An scMethrix
object
1 2 3 4 5 6 7 8 9 10 11 12 | # For dataframe-like input
data('scMethrix_data')
colData <- colData(scMethrix_data)
colData["Cluster"] <- 1:nrow(colData)
scMethrix_data <- append_colData(scMethrix_data,colData)
colData(scMethrix_data)
# For named vector input
data('scMethrix_data')
colData <- c(C1=1,C2=1,C3=1,C4=2)
scMethrix_data <- append_colData(scMethrix_data,colData, name="Cluster")
colData(scMethrix_data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.