mirror of
https://github.com/kidwellj/re_connect_survey.git
synced 2024-11-01 07:52:21 +00:00
added RColourBrewer to first pie chart as an example
This commit is contained in:
parent
ae36c3ed36
commit
064b27753a
|
@ -5,6 +5,13 @@ output: html_document
|
||||||
|
|
||||||
```{r setup, include=FALSE}
|
```{r setup, include=FALSE}
|
||||||
knitr::opts_chunk$set(echo = TRUE)
|
knitr::opts_chunk$set(echo = TRUE)
|
||||||
|
# Load RColorBrewer
|
||||||
|
# install.packages("RColorBrewer")
|
||||||
|
library(RColorBrewer)
|
||||||
|
|
||||||
|
# Define colour palettes for plots below
|
||||||
|
3clr <- brewer.pal(3, "RdYlBu") # Using RdYlBu range to generate 3 colour palette: https://colorbrewer2.org/#type=diverging&scheme=RdYlBu&n=5
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
|
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
|
||||||
|
@ -34,7 +41,7 @@ Q3_freq
|
||||||
```
|
```
|
||||||
|
|
||||||
```{r Q25 bar/pie}
|
```{r Q25 bar/pie}
|
||||||
pie(Q25_frequencies, labels = c("Maybe", "No", "Yes"))
|
pie(Q25_frequencies, labels = c("Maybe", "No", "Yes"), col = 3clr)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue