Combine multiple objects
Examples
data(RangedSummarizedExperiment, package = "AcidTest")
## SummarizedExperiment ====
x <- RangedSummarizedExperiment
colnames(x) <- paste0(
"sample",
sprintf("%02d", seq_len(ncol(x)))
)
y <- x
colnames(y) <- paste0(
"sample",
sprintf("%02d", seq(from = ncol(y) + 1L, to = ncol(y) * 2L))
)
## Combine the two objects.
c <- combine(x, y)
#> → Combining objects into `RangedSummarizedExperiment`.
#> → Binding columns in `assays()`: "counts".
#> → Checking row data.
#> → Updating column data.
#> → Updating metadata.
sampleData(c)
#> DataFrame with 24 rows and 3 columns
#> condition sampleName interestingGroups
#> <factor> <factor> <factor>
#> sample01 A sample01 A
#> sample02 A sample02 A
#> sample03 A sample03 A
#> sample04 A sample04 A
#> sample05 A sample05 A
#> ... ... ... ...
#> sample20 B sample20 B
#> sample21 B sample21 B
#> sample22 B sample22 B
#> sample23 B sample23 B
#> sample24 B sample24 B
print(c)
#> class: RangedSummarizedExperiment
#> dim: 500 24
#> metadata(4): version date interestingGroups combine
#> assays(1): counts
#> rownames(500): gene001 gene002 ... gene499 gene500
#> rowData names(10): broadClass description ... ncbiGeneId seqCoordSystem
#> colnames(24): sample01 sample02 ... sample23 sample24
#> colData names(1): condition