By: Simon Goring Date: March 7, 2016
A tutorial to test out some ideas for a Shiny/Leaflet interaction. This tutorial will be presented as part of the UBC Mozilla [R Study Group] (https://github.com/minisciencegirl/studyGroup).
The intent is to help you get started using both leaflet and Shiny together in R to do basic data exploration with geospatial data. The tutorial assumes you have some experience in R, but takes a "plug & play" approach - copy the code as is, and then play around with it. Even a beginner should be able to get this code to work.
In this tutorial you will:
- Learn briefly about leaflet & shiny
- Install the leaflet and Shiny packages
- Produce a very basic leaflet map and learn some elementary functions
- Download a file from GitHub
- Build a simply Shiny app with a slider bar and drop down menu
- Explore a dataset.
I've tried to structure the main document to be a 'chatty' tutorial, so you can walk through things on your own, but ultimately we only get so far in developing the tutorial because the workshop session is only one hour long.
Using RStudio you can fork (or clone) the repository locally and then "run" it using rmarkdown. If you do that you will have an html document wth embedded Shiny'Leaflet applets. It's pretty cool. It does run from the web, but my current hosting situation isn't great.
At the end, you'll make a nice little map like the one below, of data from the Neotoma Paleoecological Database, but the lesson is broadly applicable. I just know this data best.
You are welcome to fork & contribute to this repository, but contributors are expected to follow the Code of Conduct posted in this repository.