Leaflet 1.1.0 is now available on CRAN! The Leaflet package is a tidy wrapper for the Leaflet.js mapping library, and makes it incredibly easy to generate interactive maps based on spatial data you have in R.
This release was nearly a year in the making, and includes many important new features.
Easily add textual labels on markers, polygons, etc., either on hover or statically
Highlight polygons, lines, circles, and rectangles on hover
Built-in support for many types of objects from
[sf](https://cran.r-project.org/web/packages/sf/index.html), a new way of representing spatial data in R (all basic
sfg types except
GEOMETRYCOLLECTION are directly supported)
Color palette functions now natively support viridis palettes; use
"plasma" as the palette argument
Discrete color palette functions (
colorFactor) work much better with color brewer palettes
Integration with several Leaflet.js utility plugins
NA points or zero rows no longer causes errors
Support for linked brushing and filtering, via Crosstalk (more about this to come in another blog post)
Many thanks to @bhaskarvk who contributed much of the code for this release.
Going forward, our intention is to prevent any more Leaflet.js plugins from accreting in the core leaflet package. Instead, we have made it possible to write 3rd party R packages that extend leaflet (though the process to do this is not documented yet). In the meantime, Bhaskar has started developing his own leaflet.extras package; it already supports several plugins, for everything from animated markers to heatmaps.
We are excited to announce real-time collaborative editing on RStudio Cloud. Users can join the same project, edit code, and immediately see each other’s changes.
In this series, we walk through lesser-known tips and tricks to help you work more effectively and efficiently in R Markdown. This third post focuses on features that save you time and trouble.