-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshiny_dashboard.Rmd
63 lines (47 loc) · 1.37 KB
/
shiny_dashboard.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
# General environment / data preparation
library(flexdashboard)
library(shiny)
library(leaflet)
library(raster)
Hypoxia <- raster('data/Hypoxia.tif')
Acidification <- raster('data/Acidification.tif')
Fisheries <- raster('data/FisheriesDD.tif')
rstack <- stack(Hypoxia, Acidification, Fisheries)
```
## Column {.sidebar}
This sidebar offers the user to select which raster to visualize and combine. Under the hood, the server functions -- that is, the back end -- runs a function to sum the values of the selected rasters.
```{r select, echo = FALSE}
radioButtons(inputId = 'raster',
label = 'Rasters to select',
choices = c("Hypoxia" = "Hypoxia",
"Fisheries" = "FisheriesDD",
"Acidification" = "Acidification"))
```
Column {data-width=650}
-----------------------------------------------------------------------
### Chart A
```{r}
leafletOutput(outputId = "map", height = 800)
output$map <- renderLeaflet({
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
addRasterImage(rstack[[input$raster]])
})
```
Column {data-width=350}
-----------------------------------------------------------------------
### Chart B
```{r}
```
### Chart C
```{r}
```