get_variable {phyloseq} | R Documentation

## Get the values for a particular variable in sample_data

### Description

This is a simple accessor function for streamlining access to values/vectors/factors/etc contained in the sample_data.

### Usage

    get_variable(physeq, varName)

### Arguments

`physeq` | (Required). `sample_data-class`, or `phyloseq-class`.
`varName` | (Required). Character string of the variable name in `sample_data`. Use `sample_variables(physeq)` for available variables in your object.

### Value

Data. The clas of the data depends on what the contents of sample_data.

### See Also

`get_taxa` `taxa_names` `sample_names`

`sample_variables`

### Examples

    # Load the GlobalPatterns dataset into the workspace environment
    data(GlobalPatterns)
    # Look at the different values for SampleType
    get_variable(GlobalPatterns, "SampleType")

[Package phyloseq version 1.28.0 Index]