Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reconcile_categories

Cleans absent levels in sample_data/data.frame.


Description

This is used internally by the builder method, sample_data, to ensure that the factors describing categorical variables in a data.frame or sample_data object are free of extra levels that can plague downstream plots analysis.

Usage

reconcile_categories(DFSM)

Arguments

DFSM

(Required). A data.frame or sample_data object that needs to be cleaned.

Value

A single data.frame object. Even if the input argument is a sample_data, the return is a data.frame. Because this is intended to be used internally by the builder method, it cannot also call the builder function to re-build the cleaned sample_data.

Examples

# # # data(GlobalPatterns)
# # # SM <- sample_data(GlobalPatterns)
# # # DF <- data.frame(SM)
# # # DF <- data.frame(DF, col1=1:nrow(DF), col2=paste(1:nrow(DF), "t", sep=""))
# # # DF <- reconcile_categories(DF)
# # # SM <- sample_data(reconcile_categories(SM))
# # # sapply(DF, class)
# # # sapply(SM, class)

phyloseq

Handling and analysis of high-throughput microbiome census data

v1.34.0
AGPL-3
Authors
Paul J. McMurdie <joey711@gmail.com>, Susan Holmes <susan@stat.stanford.edu>, with contributions from Gregory Jordan and Scott Chamberlain
Initial release
2019-04-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.