r4ds/rmarkdown-demos/12-website/3-inline.Rmd

22 lines
457 B
Plaintext
Raw Normal View History

2016-08-19 01:40:09 +08:00
---
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))
```