0

Map plot

I made this map in R using ggplot . Now I want to add the interactive bar in plotly that changes the map over time. Is it possible? I tried couple of times and R keeps crashing

map <- read_sf("map.shp")
data <- read_csv("minimumwage.csv")
data_cleaned <- inner_join(map , minimumwage , by = "States")


g<- ggplot(data = data1) + geom_sf(aes(fill = "wage"))
ggplotly(p = g)

Now my original plot is interactive. All I need is to add the timeline interactive bar

Gordon
  • 19,811
  • 4
  • 36
  • 74
Nasher
  • 7
  • 3
  • 1
    It's definitely possible. However, there are a lot of different ways to make this happen. It looks like you're new to SO; welcome to the community! If you want great answers quickly, it's best to make your question reproducible. This includes sample data like the output from `dput(head(dataObject))`, any libraries you are using, and any errors/warnings received. Check it out: [making R reproducible questions](https://stackoverflow.com/q/5963269). – Kat Jun 20 '22 at 19:21
  • Yes I'm a newbie and I'm very sorry that my post doesn't meet the standards on SO . Would you give me one of the solutions . I already done everything with the original plot I just need to add that slider bar that changes the Year , Thanks for your time – Nasher Jun 20 '22 at 20:50
  • I can definitely help. It's not a big deal that you didn't know—you have to start somewhere! Edit your question and share what you've got so far and what you're looking for. You'll get a great answer really quickly. Without your data or code, to add a slider bar, you can do that with Plotly `layout`—look for `sliders`—or with the package `crosstalk`. For a more meaningful answer—I'm back at asking you to edit your question. – Kat Jun 20 '22 at 21:09
  • I'm sorry again for the trouble here's my code . After running it I get the attached image . If you need further details ,please let me know . Sorry for the inconvenience again. – Nasher Jun 20 '22 at 22:06

0 Answers0