I am trying to use ggarrange from ggpubr to create a multiple plot of Ripley's K function from spatstat, i.e. I calculate Ripley's K using Kest() for 5 landscapes and then plot them all together. Such as:
kk1plot<-plot(Kest(landscape))
However I am returning the error "Cannot convert object of class data.frame into a grob" when I try to use:
k1<-ggarrange(kk1plot,kk2plot,kk3plot,kk4plot,kk5plot,nrow=3,ncol=2)
Similarly I return the error "Only know how to add ggplots and/or grobs" when I use patchwork and the code:
k1<-wrap_plots(list(kk1plot,kk2plot,kk3plot,kk4plot,kk5plot),nrow=3,ncol=2)
Would anyone know how I could plot the output of multiple Ripley's K function as a single plot? i.e. convert the output of spatstat's Kest() into a plot that can be manipulated using one of the above lines of code?