View source: R/filter_dataset.R
| remove_samples_by_nas | R Documentation |
Removes samples with too many missing values.
remove_samples_by_nas(dataset, max.nas = 0, by.percent = FALSE)
dataset |
Dataset to modify. |
max.nas |
Maximum number of missing values allowed. |
by.percent |
Logical. If TRUE, max.nas is treated as a percentage. |
A dataset object with the same structure as the input, where samples whose number of missing values exceeds 'max.nas' have been removed from both 'dataset$data' and 'dataset$metadata'.
data <- matrix(
c(1, NA, 3,
4, 5, NA,
7, 8, 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_samples_by_nas(dataset, max.nas = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.