r4ds/rmarkdown-demos/11-dashboard.Rmd

119 lines
1.7 KiB
Plaintext

---
title: "Review Dashboard"
output:
flexdashboard::flex_dashboard:
orientation: columns
---
```{r include = FALSE}
library(viridis)
library(ggplot2)
library(marmap)
```
# Intro {.sidebar}
This dashboard covers several topics:
* The marmap package
* The viridis package
* Miscellaneous material
# Marmap Package
## Column 1
### Florida
```{r echo = FALSE}
data(florida)
autoplot(florida)
```
The [marmap](https://cran.r-project.org/web/packages/marmap/index.html) package provides tools and data for visualizing the ocean floor. Here is an example contour plot of marmap's `florida` dataset.
## Column 2
### Hawaii
```{r echo = FALSE}
data(hawaii)
autoplot(hawaii)
```
### Alaska
```{r echo = FALSE}
data(aleutians)
autoplot(aleutians)
```
# Viridis Package
## Column 1
### Viridis colors
```{r fig.cap="Maunga Whao, Auckland, NZ"}
image(volcano, col = viridis(200))
```
### Magma colors
```{r fig.cap="Maunga Whao, Auckland, NZ"}
image(volcano, col = viridis(200, option = "A"))
```
## Column 2
### Inferno colors
```{r fig.cap="Maunga Whao, Auckland, NZ"}
image(volcano, col = viridis(200, option = "B"))
```
### Plasma colors
```{r fig.cap="Maunga Whao, Auckland, NZ"}
image(volcano, col = viridis(200, option = "C"))
```
# Miscellaneous
## Column 1 {data-width=300}
### Bash support
```{bash}
ls *.Rmd
```
***
This chunk executes bash code.
### Python support
```{python}
x = 'hello, python world!'
print(x.split(' '))
```
***
This chunk executes python code.
## Column 2 {data-width=700}
### Tables with Kable
```{r echo = FALSE, results = 'asis'}
library(knitr)
kable(mtcars[1:5, ], caption = "A knitr kable.")
```
***
It is very easy to make tables with knitr's `kable` function.