View source: R/filter_dataset.R
| subset_by_samples_and_xvalues | R Documentation |
Selects samples and x values simultaneously.
subset_by_samples_and_xvalues(
dataset,
samples,
variables = NULL,
by.index = FALSE,
variable.bounds = NULL,
rebuild.factors = TRUE
)
dataset |
Dataset to subset. |
samples |
Sample indexes. |
variables |
Variables to keep. |
by.index |
Logical. If TRUE, variables are interpreted as indexes. |
variable.bounds |
Optional numeric bounds for x values. |
rebuild.factors |
If TRUE, rebuild factors in metadata. |
A dataset object with the same overall structure as the input, containing only the selected samples and selected x values. The returned object includes the corresponding subset of 'dataset$data' and matching rows of 'dataset$metadata'; factor levels are rebuilt when 'rebuild.factors = TRUE'.
data <- matrix(
1:12,
nrow = 4,
dimnames = list(c("10", "20", "30", "40"), c("s1", "s2", "s3"))
)
metadata <- data.frame(
class = factor(c("A", "B", "A")),
row.names = c("s1", "s2", "s3")
)
dataset <- list(data = data, metadata = metadata)
subset_by_samples_and_xvalues(dataset, samples = c(1, 3), variables = c("10", "30"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.