plot_mapbox: example from C Sievert's book not working when updating plotly?

I tried to recreate a map from C Sievert's great book on plotly & co (chapter 4.1.1).
Here the link.

library(plotly)
plot_mapbox(maps::canada.cities) %>%
  add_markers(
    x = ~long, 
    y = ~lat, 
    size = ~pop, 
    color = ~country.etc,
    colors = "Accent",
    text = ~paste(name, pop),
    hoverinfo = "text"
  )

Capture

The example runs as expected when using his RStudio Cloud version which loads plotly 4.9.0.9000.
If I update the package to the latest CRAN version (which I use on my machine, 4.9.2) the example doesn't work as intended. The result only shows the dots, but no map.

Any idea how to rectify this? Many thanks!
R

Just to update - I think that the observed behavior is actually unintended and a bug. I therefore filed an issue at github.

Carson Sievert was quite quick and fixed the bug. See here.

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