I can't seem to find a function by this name on that site.
Also note that there are several existing ways to approach a discrete cartogram in R. Probably the easiest to work with an sf object (say sf_dat), then you can do something like plot_ly(sf_dat, split = ~feature_id).
This won't be as performant as using the choropleth (choroplethmapbox) trace type. Off-hand I don't recall how to make discrete choropleths using these trace types, but I'm sure it's possible (you probably have to put each discrete level in it's own trace, which you can probably do via split).