Skip to contents

Remove samples from a microbiome_dataset while keeping expression_data and sample_info synchronized.

Usage

prune_samples(object, sample_id, sample_index, keep = TRUE)

Arguments

object

A microbiome_dataset object.

sample_id

Sample identifiers to keep or remove.

sample_index

Sample indices to keep or remove.

keep

Should the provided samples be kept? Defaults to TRUE.

Value

A microbiome_dataset object.

Examples

data("global_patterns", package = "microbiomedataset")

keep_samples <- global_patterns@sample_info$sample_id[1:3]
x <- prune_samples(global_patterns, sample_id = keep_samples)
dim(x@expression_data)
#> [1] 19216     3