mirror of
				https://github.com/kidwellj/re_connect_survey.git
				synced 2025-10-30 15:24:09 +00:00 
			
		
		
		
	added RColourBrewer to first pie chart as an example
This commit is contained in:
		
							parent
							
								
									ae36c3ed36
								
							
						
					
					
						commit
						064b27753a
					
				
					 1 changed files with 8 additions and 1 deletions
				
			
		|  | @ -5,6 +5,13 @@ output: html_document | |||
| 
 | ||||
| ```{r setup, include=FALSE} | ||||
| 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. | ||||
|  | @ -34,7 +41,7 @@ Q3_freq | |||
| ``` | ||||
| 
 | ||||
| ```{r Q25 bar/pie} | ||||
| pie(Q25_frequencies, labels = c("Maybe", "No", "Yes")) | ||||
| pie(Q25_frequencies, labels = c("Maybe", "No", "Yes"), col = 3clr) | ||||
| 
 | ||||
| ``` | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue