Skip to contents

This function sets a specific component of a microbiome dataset object as active. It allows the user to specify which part of the dataset to work with.

Usage

activate_microbiome_dataset(
  .data,
  what = c("sample_info", "variable_info", "expression_data")
)

Arguments

.data

The microbiome dataset object.

what

A character string specifying the component to activate. Options are "sample_info", "variable_info", or "expression_data". Default is "sample_info".

Value

The modified microbiome dataset object with the specified component activated.

Details

The function uses the slot function to assign the active component to the 'activated' slot of the microbiome dataset object. This makes it easier to work with specific parts of the dataset in subsequent analyses.

Note

It's essential to ensure that the microbiome dataset object has the necessary structure and slots to use this function effectively.

Author

Xiaotao Shen xiaotao.shen@outlook.com

Examples

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

x <- activate_microbiome_dataset(global_patterns, what = "sample_info")
x@activated
#> [1] "sample_info"