New to Plotly?
Plotly's R library is free and open source!
Get started by downloading the client and reading the primer.
You can set up Plotly to work in online or offline mode.
We also have a quick-reference cheatsheet (new!) to help you get started!
##  '4.9.1'
In order to complete the examples below, you'll require installing additional packages (
The examples below use the library simple features to read in the shape files before plotting the features with Plotly.
library(plotly) library(sf) nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) p <- ggplotly( ggplot(nc) + geom_sf(aes(fill = AREA)) ) p
Using Native Plotly
Alternatively, you can use