added RColourBrewer to first pie chart as an example, fixed var names

This commit is contained in:
Jeremy Kidwell 2021-10-27 13:22:49 +01:00
parent 064b27753a
commit 758d601504

View file

@ -10,7 +10,7 @@ knitr::opts_chunk$set(echo = TRUE)
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
coul3 <- brewer.pal(3, "RdYlBu") # Using RdYlBu range to generate 3 colour palette: https://colorbrewer2.org/#type=diverging&scheme=RdYlBu&n=5
```
@ -41,7 +41,7 @@ Q3_freq
```
```{r Q25 bar/pie}
pie(Q25_frequencies, labels = c("Maybe", "No", "Yes"), col = 3clr)
pie(Q25_frequencies, labels = c("Maybe", "No", "Yes"), col = coul3)
```