-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCN_slides.Rmd
51 lines (48 loc) · 1.78 KB
/
CN_slides.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
title: "`r paste0(title_line1)` <br> `r paste0(title_line2)`"
output: ioslides_presentation
css: slides.css
# logo: Scottish_Government_logo_RGB.jpg
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
```{r title, include=FALSE}
title <- title_var
```
```{r all_plots, echo=FALSE, message=FALSE,results = "asis"}
for (i in Output_types) {
cat("## Slide with Plot \n")
cat("<div style=\"float: left; width: 75%;\">")
# Use the output_plot function to create four plots, and then arrange in a grid.
# Input arguments are type, title, quantity and y-axis label
g_co2perha <- output_plot(i, "Absolute emissions", "t CO2-e per ha", "t CO"[2]~"-e / ha", "#23A845")
g_co2perkg <- output_plot(i, "Emission intensity", "kg CO2-e per kg output", "kg CO"[2]~"-e / kg output", "#23A845")
g_Nsurplus <- output_plot(i, "Nitrogen balance", "Nitrogen surplus (kg)", "kg N surplus / ha", "#80BA27")
g_NUE <- output_plot(i, "Nitrogen use efficiency", "Nitrogen use efficiency (%)", "NUE (%)", "#80BA27")
if(i==9){
farmtype_title <- "All farm types"
} else{
farmtype_title <- fbs_type_words[i]
}
g_grid <- grid.arrange(g_co2perha, g_co2perkg, g_Nsurplus, g_NUE,
top=textGrob(farmtype_title,gp=gpar(fontsize=20,font=2),x=0,hjust=0))
cat("</div>")
cat("<div style=\"float: right; width: 25%;\">")
# ```{r commentaries, results="asis"}
##Individual farmtype commentaries
#Cereal
if(i==1){cat('Cereals, such as barley and wheat are lorum ipsum...')}
#General cropping
if(i==2){cat('General cropping commentary goes here...')}
#Dairy
if(i==3){cat('Dairy farms produce milk. \n A second paragraph goes here.')}
#Mixed
if(i==8){cat('')}
#All farms
if(i==9){cat('')}
#All LFA livestock farms
if(i==10){cat('')}
cat('</div>')
}
```