sample_data-methods: Build or access sample_data.

Description Usage Arguments Value See Also Examples

Description

This is the suggested method for both constructing and accessing a table of sample-level variables (sample_data-class), which in the phyloseq-package is represented as a special extension of the data.frame-class. When the argument is a data.frame, sample_data will create a sample_data-class object. In this case, the rows should be named to match the sample_names of the other objects to which it will ultimately be paired. Alternatively, if the first argument is an experiment-level (phyloseq-class) object, then the corresponding sample_data is returned. Like other accessors (see See Also, below), the default behavior of this method is to stop with an error if object is a phyloseq-class but does not contain a sample_data.

Usage

1
2
3
4
5
6
7
sample_data(object, errorIfNULL=TRUE)

## S4 method for signature 'ANY'
sample_data(object, errorIfNULL = TRUE)

## S4 method for signature 'data.frame'
sample_data(object)

Arguments

object

(Required). A data.frame-class, or a phyloseq-class object.

errorIfNULL

(Optional). Logical. Should the accessor stop with an error if the slot is empty (NULL)? Default TRUE.

Value

A sample_data-class object representing the sample variates of an experiment.

See Also

phy_tree, tax_table, otu_table phyloseq, merge_phyloseq

Examples

1
2
3

Example output

Sample Data:        [6 samples by 4 sample variables]:
       Treatment warmed clipped Sample
a_C026        UC     no     yes    6CC
a_C066        UU     no      no    3UC
a_C070        WU    yes      no    5UW
a_C074        UU     no      no    2UC
a_C075        WC    yes     yes    5CW
a_C077        WU    yes      no    4UW

phyloseq documentation built on Nov. 8, 2020, 6:41 p.m.