pstoveg_sd: converts the sam_data slot of a phyloseq object to a...

Description Usage Arguments Value See Also Examples

Description

physeq2veg_sd is a helper function intended to convert the sample data slot of a phyloseq object to a vegan-friendly matrix.

Usage

1

Arguments

PS

(required) a phyloseq object

Value

A matrix containing a phyloseq object's sam_data slot.

See Also

phyloseq-class sample_data-class sample_data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
library(theseus)
library(phyloseq)
data(WWTP_Impact, package='theseus')
dim(sample_data(WWTP_Impact))
sampdat <- pstoveg_sd(WWTP_Impact)
dim(sampdat)

data(GlobalPatterns, package='phyloseq')
dim(sample_data(GlobalPatterns))
sampdat.gp <-pstoveg_sd(GlobalPatterns)
dim(sampdat.gp)

# move altered sample data back to phyloseq
sampdat.altered <- sampdat
sampdat.altered$TotDisP_PercentMax <- vegan::decostand(sampdat$TotDisP,
                                                       method='max')
sample_data(wwtp) <- as.data.frame(sampdat.altered)

## End(Not run)

EESI/theseus documentation built on May 24, 2019, 7:21 p.m.