View source: R/filter_dataset.R
| subset_x_values | R Documentation |
Selects rows of the dataset by x values or by row index.
subset_x_values(dataset, variables, by.index = FALSE)
dataset |
Dataset to subset. |
variables |
Variables to keep. |
by.index |
Logical. If TRUE, variables are interpreted as row indexes. |
A dataset object with the same structure as the input, where 'dataset$data' contains only the selected variables or row indexes.
data <- matrix(
1:9,
nrow = 3,
dimnames = list(c("10", "20", "30"), c("s1", "s2", "s3"))
)
metadata <- data.frame(group = c("A", "B", "A"), row.names = c("s1", "s2", "s3"))
dataset <- list(data = data, metadata = metadata)
subset_x_values(dataset, c("10", "30"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.