I need help with ggplot. I have a big dataframe including different species collected in different years. For each species and year there are two samples and each sample represents a length frequency distributions. I need to create a ggplot function to plot the same plot for the different species, year, and sample. Hereunder the code for one plot taht I used several times:
ggplot(df, aes(x=lenClass, y=Ntot, fill=Sex)) +
geom_bar(stat="identity") +
facet_grid(Year~DayTime) + theme_bw() +
xlab('CL mm') + ylab('No.individuals') +
ggtitle("StrataN1 - Sp1") +
theme(axis.title.x = element_text(size=13),
axis.title.y = element_text(size=13),
plot.title = element_text(size = 14),
strip.text.x = element_text(size=10.5),
strip.text.y = element_text(size=8),
axis.text.x = element_text(size=8.5),
axis.text.y = element_text(size=7.5))
Thank you so much!