Skip to content

Commit

Permalink
Updates Reproducible research chapter.
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettgman committed Aug 18, 2016
1 parent a3a3417 commit 4cf15b5
Show file tree
Hide file tree
Showing 86 changed files with 11,365 additions and 71 deletions.
Binary file added images/RMarkdownFlow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/how-1-file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/how-2-chunk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/interactive-1-htmlwidget.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/interactive-2-shiny.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/outputs-2-pdf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/outputs-3-toc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/params-1-hawaii.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/params-2-aleutians.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/params-3-florida.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/tables-2-kable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/website-2-website.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
428 changes: 357 additions & 71 deletions reproducible-research.Rmd

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions rmarkdown-demos/1-example.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 1,22 @@
---
title: "Viridis Demo"
output: html_document
---

```{r include = FALSE}
library(viridis)
```

The code below demonstrates two color palettes in the [viridis](https://github.com/sjmgarnier/viridis) package. Each plot displays a contour map of the Maunga Whau volcano in Auckland, New Zealand.

## Viridis colors

```{r}
image(volcano, col = viridis(200))
```

## Magma colors

```{r}
image(volcano, col = viridis(200, option = "A"))
```
118 changes: 118 additions & 0 deletions rmarkdown-demos/11-dashboard.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 1,118 @@
---
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.
Binary file added rmarkdown-demos/12-website.zip
Binary file not shown.
22 changes: 22 additions & 0 deletions rmarkdown-demos/12-website/1-example.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 1,22 @@
---
title: "Viridis Demo"
output: html_document
---

```{r include = FALSE}
library(viridis)
```

The code below demonstrates two color palettes in the [viridis](https://github.com/sjmgarnier/viridis) package. Each plot displays a contour map of the Maunga Whau volcano in Auckland, New Zealand.

## Viridis colors

```{r}
image(volcano, col = viridis(200))
```

## Magma colors

```{r}
image(volcano, col = viridis(200, option = "A"))
```
21 changes: 21 additions & 0 deletions rmarkdown-demos/12-website/3-inline.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 1,21 @@
---
title: "More colors"
output: html_document
---

```{r include = FALSE}
# colorFunc <- "heat.colors"
colorFunc <- "terrain.colors"
# colorFunc <- "topo.colors"
# colorFunc <- "cm.colors"
# colorFunc <- "rainbow"
```

Base R comes with many functions for generating colors. The code below demonstrates the `r colorFunc` function.

## `r colorFunc`

```{r fig.cap = "The Maunga Whau volcano.", echo = FALSE}
image(volcano, col = get(colorFunc)(200))
```
10 changes: 10 additions & 0 deletions rmarkdown-demos/12-website/_site.yml
Original file line number Diff line number Diff line change
@@ -0,0 1,10 @@
name: "my-website"
navbar:
title: "My Website"
left:
- text: "Home"
href: index.html
- text: "Viridis Colors"
href: 1-example.html
- text: "Terrain Colors"
href: 3-inline.html
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4cf15b5

Please sign in to comment.