if (FALSE) {
library(ggpicrust2)
library(readr)
# Example 1: Demonstration with a hypothetical input file
# Prepare an input file path
input_file <- "path/to/your/picrust2/results/pred_metagenome_unstrat.tsv"
# Run ko2kegg_abundance function
kegg_abundance <- ko2kegg_abundance(file = input_file)
# Alternatively, read the data from a file and use the data argument
file_path <- "path/to/your/picrust2/results/pred_metagenome_unstrat.tsv"
ko_abundance <- read_delim(file_path, delim = "\t")
kegg_abundance <- ko2kegg_abundance(data = ko_abundance)
# Example 2: Working with real data
# In this case, we're using an existing dataset from the ggpicrust2 package.
# Load the data
data(ko_abundance)
# Apply the ko2kegg_abundance function to our real dataset
kegg_abundance <- ko2kegg_abundance(data = ko_abundance)
}
Run the code above in your browser using DataLab