superimpose several ggplot to make a map - r

I am trying to make a map using R but I have some problems. The datas I have are shapefiles. I used ggplot to visualise them with this code :
ggplot(farmscot)+geom_sf()
ggplot(scotland)+geom_sf()
ggplot(river)+geom_sf()
and it gives me different graphs like this:
but I need them to be superimpose to make the map. How can I do please?
When I try to add them together R says I can't add ggplots together
Would really appreciate some help and advice, Thank you in advance

Related

Wanna create difficult area chart in R

I'm trying to create a graph on the right. Can you recommend a good code in R? Thanks!
Look at the graph on the right side
New to R code, only know the basics

R how to plot paragons of HCPC?

I need to do a graph for my paragons of hcpc, can someone help me?
I just know how to extract them
res.HCPC2$desc.ind$para
I was just trying to plot it directly but obviously it doesnt work
plot(res.HCPC2$desc.ind$para)

Using ggplot to plot a customizable table of data

This idea has been spurred by this work at Five Thirty Eight.
I'm not entirely sure that they used R, but the chart appears in a similar fashion to their other data viz. I looked around here, but couldn't find anything directly relating to this.
Is this kind of plot possible using ggplot?
Thanks for any and all help!
They do use R but their ggplot2 theme is semi-proprietary and they don't say what they use. People have attempted to recreate the theme
https://github.com/jrnold/ggthemes
After the graphs are created it then goes through an illustrative step to bring graphs together and make them more of a story.

Multiple R plots with tooltips in one figure?

I want to create a new figure with interactive R-plots (with tooltips).
To show how I wish to have my plots I give an example using the mtcars data. I am using the package scatterD3 to get tooltips:
library(scatterD3)
data(mtcars)
tooltips <- paste('This is an incredible <strong>',rownames(mtcars),'</strong><br />with',mtcars$cyl,'cylinders !')
scatterD3(x=mtcars$wt,y=mtcars$mpg,tooltip_text=tooltips)
Now I don't want only one plot of this type in one figure. Usually it is possible to use par(mfrow=(i,j)) to create a figure with more than one plot. But it seems not to work for my interactive plots. Is there a way to do this?
Have you given a look to the plotly R package?
It has also a function to render the ggplots in ggplotly
An idea could be to create a multiplot with ggplot2 and than render it with ggplotly.
I've not yet tried it, so I don't know if it's really possible.

plotGoogleMaps query for plotting maps with four columns

Helo All,
I am using plotGoogleMaps package for plotting piecharts on world map. segmentgooglemap is the function in this package that does this. Here is the manual http://cran.r-project.org/web/packages/plotGoogleMaps/vignettes/plotGoogleMaps-intro.pdf. if I try to plot piechart for 3 column it works fine like given in manual for zinc, lead, copper. But if I try to plot for 4 columns it doesnot work. Can anyone guide me why it is showing so. I have tried many options but didnt succeed. Looking forward for reply.
Regards,
Gourja

Resources