I am creating a relative abundance boxplot comparing two groups (pet, stray) using eight genera. However, the resulting plot displays almost zero values on the y-axis and only one value on the x-axis. I aim to generate a boxplot comparing the relative abundance of eight genera across two groups (pet, stray). How can I modify my code to achieve this?
I suspect that one genus has a significantly different scale of relative abundance, potentially causing the issue with the y-axis. If transforming the y-axis is an effective solution, please suggest appropriate transformations for the relative abundance values with revised code.
my R code is
library(ggplot2)
data <- read.csv("relative abundance raw data (putative pathogen).csv")
p<-ggplot(data, aes(x="Genus", y="Relative_abundance", fill="Group")) +
geom_boxplot(position = position_dodge(width = 0.8), alpha = 0.8) +
labs(title = "Relative Abundance Comparison",
x = "Genus",
y = "Relative Abundance",
fill = "Group") +
theme_minimal() +
scale_fill_manual(values = c("stray" = "blue", "pet" = "red"))
p + geom_jitter(shape=16, position=position_jitter(0.2))
the result figure :
my raw data format is :
My raw data file can be downloaded here : relative abundance raw data (putative pathogen).csv - Google Drive
Thank you for your assistance !