View source: R/filter_dataset.R
| remove_data | R Documentation |
Removes selected samples, data variables, or metadata variables from a dataset.
remove_data(
dataset,
data.to.remove,
type = "sample",
by.index = FALSE,
rebuild.factors = TRUE
)
dataset |
Dataset to modify. |
data.to.remove |
Data to remove. |
type |
One of "sample", "data", or "metadata". |
by.index |
Logical. If TRUE, data.to.remove has indexes. |
rebuild.factors |
Logical. If TRUE, rebuild factors in metadata. |
A dataset object with the same overall structure as the input, where the requested samples, data variables, or metadata variables have been removed according to 'type'.
data <- matrix(
1:9,
nrow = 3,
dimnames = list(c("x1", "x2", "x3"), c("s1", "s2", "s3"))
)
metadata <- data.frame(class = c("A", "B", "A"), row.names = c("s1", "s2", "s3"))
dataset <- list(data = data, metadata = metadata)
remove_data(dataset, "s2", type = "sample")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.