ezclean {mbX} | R Documentation |
Clean and Process Microbiome Data
Description
Processes microbiome and metadata files (e.g., 16S rRNA sequencing data) to produce an analysis-ready dataset. Supports CSV, TXT, and 'Excel' file formats. This function validates file formats, reads the data, and merges the datasets by the common column 'SampleID'. If a 'Taxonomy' column exists, the data are filtered to include only rows matching the provided taxonomic level.
Usage
ezclean(microbiome_data, metadata, level = "d")
Arguments
microbiome_data |
A string specifying the path to the microbiome data file. |
metadata |
A string specifying the path to the metadata file. |
level |
A string indicating the taxonomic level for filtering the data (e.g., "genus"). |
Value
A data frame containing the cleaned and merged dataset.
Examples
# Example usage (ensure that 'inst/extdata' contains the appropriate files,
# or modify this example to use your own data)
microbiome_data <- system.file("extdata", "microbiome.csv", package = "mbX")
metadata <- system.file("extdata", "metadata.csv", package = "mbX")
if (nzchar(microbiome_data) && nzchar(metadata)) {
cleaned_data <- ezclean(microbiome_data, metadata, "genus")
head(cleaned_data)
} else {
message("Sample data files not found.")
}
[Package mbX version 0.1.3 Index]