Interactive Maps with information on Rstudio

Asked

Viewed 46 times

2

I have a map mounted and already defined by locality code and with data display by color tone. I used the command:

munipb <- read_municipality(code_muni = 'PB')

I have 2 variables in the spreadsheet called "code_muni" and "quantity produced". I was able to put together a map showing the level of production per region.

Using the command:

produtox <- inner_join(munipb, produtox,by= "code_muni")

produtoxplot <- ggplot(produtox)+
geom_sf(aes(fill=produtox))

Upshot: Resultado final

However, I need to demonstrate the values within the map itself with a command that does this by hovering the mouse over some region, showing a simple description like: name of the location and quantity produced. within the R itself. Thus:mapa ideal

I saw some doing it using the command readOGR, but did not run on my computer and other ways to do with leaflet - saved mistake - need the data in a totally different way.

I am grateful if you can help me. Presenting the data as in the first image is a bit complicated. And the shape of the last image would be ideal

  • 1

    Have a look at ggplotly https://plotly.com/ggplot2/maps-sf/

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.