Hello all! I am very new to RStudio and I have reached a block in my data analysis.
I have already plotted bird captures over time for two age classes of birds. I have one column for date, and two columns that summarize how many birds I captured for each day for each age class (SY and ASY). From this data, I have been able to summarize it with this graph:
using this code:
ggplot(data = MYWA, aes(x = DATE, y = SY))+
geom_point()+
stat_smooth(aes(x = DATE, y = SY), color="black", se= FALSE)+
geom_point(y=ASY, color="red")+
labs(y= "Number of Individuals", x = "Date", title="MYWA Spring" )+
stat_smooth(aes(x = DATE, y = ASY), color = "red", se= FALSE)+
ylim(0,11)
My next step that I am trying (and failing) to figure out is how to find the maximum y value for each line (the highest point). I saw on a few sites where someone had used smooth_vals but I have no idea which package I need to download to be able to use it!
Any help is greatly appreciated! It seems like it should be much easier than it is but I've been working on this problem for a few hours and I still have no clue!!