How to stack/merge geom_stars items/plots in one - in R

If I have plotted the Relative Error Maps for the Silt soil attribute for the following 4 different soil types: Cambisols, calcisols, leptosols and fluvisols that form my study case area:

ggplot() +
  geom_stars(data=mydata.krig["Clay.relerror"]) +
  scale_fill_gradient(low="yellow", high="dark blue", limits=c(28.82262,40.85597)) +
  coord_fixed(ratio = 1) +
  ggtitle("Relative error (%) - Clay- Stratified Kriging
                         Cambisols") +

With this part of the code i made the following maps:

I have followed this procedure also for the other 2 soil types i ve got inmy sptudy area (Calcisols, Fluvisols), and i want to combine these 3 maps in one, so as to show the relative error for the soil attribute in total (so as not to have any spaces in the whole area). Is it possible to merge these 3 ggplots in one so as to plot the holistic relative error map for clay?

Are you able to share your data, or a representative subset?

They are point data of observations with X, Y coordinates in different columnsin a .csv file type.
*PS it does not allow me to upload the csv file

Can you copy and paste the output of the function below?


# if the above result is too large, try the following
dput(head(mydata.krig, 40))

I'm sure you shared this image with the best intentions, but perhaps you didnt realise what it implies.
If someone wished to use example data to test code against, they would type it out from your screenshot...

This is very unlikely to happen, and so it reduces the likelihood you will receive the help you desire.
Therefore please see this guide on how to reprex data. Key to this is use of either datapasta, or dput() to share your data as code

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.