-
Notifications
You must be signed in to change notification settings - Fork 2
/
protocol_output.Rmd
47 lines (41 loc) · 1.5 KB
/
protocol_output.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
---
output: word_document
params:
study_title: "Study title"
authors: "Authors"
title: "`r paste0(params$study_title)`"
author: "`r paste0(params$authors)`"
subtitle: "– ODMAP Protocol –"
date: "`r Sys.Date()`"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, eval=TRUE, message=FALSE, warning=FALSE)
```
---
```{r, results = 'asis'}
section = ""
subsection = ""
odmap_dict_rmd = filter(odmap_dict,! element_id %in% c("o_title_1", "o_authorship_1", "o_authorship_2"))
for(i in 1:nrow(odmap_dict_rmd)){
# Find out if new section header needs to be rendered
section_new = odmap_dict_rmd$section_id[i]
if(section_new != section & !(section_new %in% elem_hide[[input$o_objective_1]])){
section = section_new
knit_section(section)
}
# Find out if new subsection header needs to be rendered
subsection_new = odmap_dict_rmd$subsection_id[i]
if(subsection_new != subsection & !(subsection_new %in% elem_hide[[input$o_objective_1]])){
subsection = subsection_new
knit_subsection(subsection)
}
# Render elements
switch(odmap_dict_rmd$element_type[i],
text = knit_text(odmap_dict_rmd$element_id[i]),
suggestion = knit_suggestion(odmap_dict_rmd$element_id[i]),
objective = knit_suggestion(odmap_dict_rmd$element_id[i]),
extent = knit_extent(odmap_dict_rmd$element_id[i]),
model_algorithm = knit_suggestion(odmap_dict_rmd$element_id[i]),
model_setting = knit_model_settings(odmap_dict_rmd$element_id[i]))
}
```