I am looking for a way to combine two plots. Using ggarrange I have already been able to put them in one figure, but now I would like to combine them with two Y-axis. Unfortunately, I am not getting anywhere at the moment. R is still completely new territory for me. There are some explanations on the internet but unfortunately I have problems applying them to my specific data set. I am honest.
In Case anybody is interested: The upper graph symbolises the moon phase. 1 is full moon and 0 is new moon. The lower graph with geom_col() symbolises animals photographed by a camera trap. The goal is to determine the activity as a function of the moon phase.
The code I used for the two plots is:
ggarrange( ggplot(d1, aes(x = Datum, y = mondphase)) + geom_smooth(span = .2, se = FALSE) + ylab("Mondphase") + xlab("") + theme_bw() , ggplot(d1, aes(x = Datum, y = Number.of.Animals)) + geom_col(show.legend = FALSE) + ylab("Anzahl Auslösungen") + theme_bw() , ncol = 1, align = "v", heights = 1:2 )