forked from szimmer/tidy-survey-aapor-2021
-
Notifications
You must be signed in to change notification settings - Fork 18
/
FinalizeMaterials.R
72 lines (60 loc) · 2.38 KB
/
FinalizeMaterials.R
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
### This program creates PDF slides, PPTX slides, and R files from the Rmd files
# remotes::install_github("jhelvy/xaringanBuilder")
# remotes::install_github('rstudio/chromote')
# install.packages('pdftools')
# install.packages('officer')
library(knitr)
library(here)
mypurl <- function(folder, fn){
purl(here(folder, stringr::str_c(fn, ".Rmd")),
output=here(folder, stringr::str_c(fn, ".R")),
documentation=2)
}
# Day 1 processing
mypurl("Presentation", "Slides-day-1")
xaringanBuilder::build_html(
input=here("Presentation", "Slides-day-1.Rmd"),
output_file=here("Presentation", "Slides-day-1.html"))
xaringanBuilder::build_pdf(
input=here("Presentation", "Slides-day-1.html"),
output_file=here("Presentation", "Slides-day-1.pdf"),
partial_slides= TRUE)
xaringanBuilder::build_pptx(
input=here("Presentation", "Slides-day-1.pdf"),
output_file=here("Presentation", "Slides-day-1.pptx"),
partial_slides= TRUE)
mypurl("Exercises", "CategorialExercises")
mypurl("Exercises", "CategorialExercises_solutions")
# Day 1/2 processing
mypurl("Exercises", "WarmUpExercises")
mypurl("Exercises", "WarmUpExercises_solutions")
# Day 2 processing
mypurl("Presentation", "Slides-day-2")
xaringanBuilder::build_html(
input=here("Presentation", "Slides-day-2.Rmd"),
output_file=here("Presentation", "Slides-day-2.html"))
xaringanBuilder::build_pdf(
input=here("Presentation", "Slides-day-2.html"),
output_file=here("Presentation", "Slides-day-2.pdf"),
partial_slides= TRUE)
xaringanBuilder::build_pptx(
input=here("Presentation", "Slides-day-2.pdf"),
output_file=here("Presentation", "Slides-day-2.pptx"),
partial_slides= TRUE)
mypurl("Exercises", "ContinuousExercises")
mypurl("Exercises", "ContinuousExercises_solutions")
# Day 3 processing
mypurl("Presentation", "Slides-day-3")
xaringanBuilder::build_html(
input=here("Presentation", "Slides-day-3.Rmd"),
output_file=here("Presentation", "Slides-day-3.html"))
xaringanBuilder::build_pdf(
input=here("Presentation", "Slides-day-3.html"),
output_file=here("Presentation", "Slides-day-3.pdf"),
partial_slides= TRUE)
xaringanBuilder::build_pptx(
input=here("Presentation", "Slides-day-3.pdf"),
output_file=here("Presentation", "Slides-day-3.pptx"),
partial_slides= TRUE)
mypurl("Exercises", "DesignDerivedVariablesExercises")
mypurl("Exercises", "DesignDerivedVariablesExercises_solutions")