extract_metadata_phyloseq: extract_metadata_phyloseq

View source: R/extract_metadata_phyloseq.R

extract_metadata_phyloseqR Documentation

extract_metadata_phyloseq

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

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

extract_metadata_phyloseq(demo_phyloseq_object)

yeguanhuav/visualization416S documentation built on March 22, 2022, 9:03 p.m.