extract_metadata_phyloseq: extract_metadata_phyloseq

Description Usage Arguments Examples

View source: R/extract_metadata_phyloseq.R

Description

extract_metadata_phyloseq can extract metadata from a phyloseq object. First, the function will extract metadata from phyloseq object using phyloseq::sample_data, and turn it into a tibble which will turn rownames into a column name 'SampleID'. If feature parameter is given, then will select SampleID and feature column, and add levels to the selected feature column.

Usage

1
extract_metadata_phyloseq(phyloseq, feature = NA, col_name = "SampleID")

Arguments

phyloseq

A phyloseq object contain otu table, taxonomy table, sample metadata and phylogenetic tree.

feature

The column name of the feature you want to select. Default is NA. If NA, will return the complete metadata, else will return subject id and feature column that's given.

col_name

Name of column to use for rownames. Default is "SampleID". If If 'SampleID' is in origin metadata, rename it with 'SampleID_origin'.

Examples

1
extract_metadata_phyloseq(demo_phyloseq_object)

yeguanhuav/visual16S documentation built on Feb. 19, 2022, 10:32 a.m.