Tutorial by Examples

The function map() from the package maps provides a simple starting point for creating maps with R. A basic world map can be drawn as follows: require(maps) map() The color of the outline can be changed by setting the color parameter, col, to either the character name or hex value of a color...
A common question is how to juxtapose (combine) physically separate geographical regions on the same map, such as in the case of a choropleth describing all 50 American states (The mainland with Alaska and Hawaii juxtaposed). Creating an attractive 50 state map is simple when leveraging Google Maps...
The plotly package allows many kind of interactive plots, including maps. There are a few ways to create a map in plotly. Either supply the map data yourself (via plot_ly() or ggplotly()), use plotly's "native" mapping capabilities (via plot_geo() or plot_mapbox()), or even a combination o...
Leaflet is an open-source JavaScript library for making dynamic maps for the web. RStudio wrote R bindings for Leaflet, available through its leaflet package, built with htmlwidgets. Leaflet maps integrate well with the RMarkdown and Shiny ecosystems. The interface is piped, using a leaflet() funct...
The Leaflet package is designed to integerate with Shiny In the ui you call leafletOutput() and in the server you call renderLeaflet() library(shiny) library(leaflet) ui <- fluidPage( leafletOutput("my_leaf") ) server <- function(input, output, session){ out...

Page 1 of 1