View source: R/filter_dataset.R
| merge_data_metadata | R Documentation |
Merges data and metadata into a data frame.
merge_data_metadata(
dataset,
samples = NULL,
metadata.vars = NULL,
x.values = NULL,
by.index = FALSE
)
dataset |
Dataset to merge. |
samples |
Samples to keep. |
metadata.vars |
Metadata variables to keep. |
x.values |
X values to keep. |
by.index |
Logical. If TRUE, x.values are indexes. |
A 'data.frame' containing the selected data matrix, transposed so that samples are rows, combined with the selected metadata columns.
data <- matrix(
1:6,
nrow = 2,
dimnames = list(c("x1", "x2"), c("s1", "s2", "s3"))
)
metadata <- data.frame(
class = c("A", "B", "A"),
batch = c(1, 1, 2),
row.names = c("s1", "s2", "s3")
)
dataset <- list(data = data, metadata = metadata)
merge_data_metadata(dataset, metadata.vars = "class")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.