Template for the shiny built as part of cws-shiny-workshop
This shiny application allows a user to:
- filter a dataset and visualize as a table
- Group
- Month
- filter a spatial object and visualize as a map
- summarize data based on filters selected in 1 and 2
The data used for this application is the Atlas of Seabirds at Sea in Eastern Canada 2006 - 2016 (Bolduc et al. 2016) available on the Open Government Portal here.
resources <- list(
gdb = list(
file = "AtlasGrid-GrilleAtlas.gdb.zip",
location = "http://data.ec.gc.ca/data/species/assess/atlas-of-seabirds-at-sea-in-eastern-canada-2006-2016/AtlasGrid-GrilleAtlas.gdb.zip",
outputdir = "data"
),
density = list(
file = "DensityData-DonneesDeDensite.xlsx",
location = "http://data.ec.gc.ca/data/species/assess/atlas-of-seabirds-at-sea-in-eastern-canada-2006-2016/DensityData-DonneesDeDensite.xlsx",
outputdir = "data"
),
dictionnary = list(
file = "DataDictionary-DictionnaireDeDonnees.xlsx",
location = "http://data.ec.gc.ca/data/species/assess/atlas-of-seabirds-at-sea-in-eastern-canada-2006-2016/DataDictionary-DictionnaireDeDonnees.xlsx",
outputdir = "data"
)
)
- Install packages
pkgs <- c(
"DT",
"leaflet",
"readxl",
"sf",
"shiny",
"tidyverse"
)
# Tell us which one is not already installed
install_pkgs <- pkgs[!pkgs %in% installed.packages()]
# Install the missing dependancies
for(lib in install_pkgs) install.packages(lib, dependencies=TRUE)
# Load all packages dependancies
sapply(pkgs, require, character=TRUE)
# Download the data required
source("setup.R")