Hi there, I'm new to the forum so please excuse me if this topic has been addressed.
I am using the package phyloseq to analyze microbiome community data. If I understand correctly, phyloseq uses ggplot2 to graph results.
From phyloseq, you can graph species richness (a count of the number of species) and a series of other species diversity indices by sample.
I was wondering if there was a way to extract the data from the graph so you can see or output the x y coordinates. The reason for doing this is that you may want to use the x y data in a table rather than a graph, etc.
Here is some code to see how this works:
site_raw = merge_samples(fungi, "Site")
sample_data(site_raw)$Site = sample_names(site_raw)
site_plot <- plot_richness(site_raw, x="Site", measures=c("Observed", "Chao1", "Shannon"))
site_plot2 <- plot_richness(site_raw, x="Site")
Site_plot and site_plot2 are objects that create nice scatterplots of the data. Depending on the species diversity index there may also be standard deviation error bars as well.
Thank you in advance,
bugguy