-
Notifications
You must be signed in to change notification settings - Fork 3
/
printing.R
63 lines (42 loc) · 2.19 KB
/
printing.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
library(tidyverse)
# install.packages("renderthis")
# Chrome browser needs to be installed for this to work!
# base directory
base <- "~/git_projects/KA_slides"
# screen for Rmds
Rmd_files <- dir(recursive = T) %>%
str_subset(pattern = ".*(\\.Rmd|rmd)") %>%
str_subset(pattern = "^(?!index).*$")
file_nms <- Rmd_files %>% str_remove(pattern = "\\.rmd|.Rmd$")
# generate HTML and PDF files (for all chapters; takes a moment)
walk(
.x = paste0(base, "/", Rmd_files),
.f = ~ renderthis::to_html(.)
)
walk(
.x = paste0(base, "/", Rmd_files),
.f = ~ renderthis::to_pdf(.)
)
# for the individual chapters
renderthis::to_pdf("~/git_projects/KA_slides/Introduction/Introduction.Rmd")
renderthis::to_html("~/git_projects/KA_slides/Introduction/Introduction.Rmd")
renderthis::to_pdf("~/git_projects/KA_slides/ResearchQuestions/ResearchQuestions.Rmd")
renderthis::to_html("~/git_projects/KA_slides/ResearchQuestions/ResearchQuestions.Rmd")
renderthis::to_pdf("~/git_projects/KA_slides/TreatmentEffects/TreatmentEffects.Rmd")
renderthis::to_html("~/git_projects/KA_slides/TreatmentEffects/TreatmentEffects.Rmd")
renderthis::to_pdf("~/git_projects/KA_slides/Matching/Matching.Rmd")
renderthis::to_html("~/git_projects/KA_slides/Matching/Matching.Rmd")
renderthis::to_pdf("~/git_projects/KA_slides/Simulation/Simulation.Rmd")
renderthis::to_html("~/git_projects/KA_slides/Simulation/Simulation.Rmd")
renderthis::to_pdf("~/git_projects/KA_slides/EventStudies/EventStudies.Rmd")
renderthis::to_html("~/git_projects/KA_slides/EventStudies/EventStudies.Rmd")
renderthis::to_pdf("~/git_projects/KA_slides/FixedEffects/FixedEffects.Rmd")
renderthis::to_html("~/git_projects/KA_slides/FixedEffects/FixedEffects.Rmd")
renderthis::to_pdf("~/git_projects/KA_slides/DiD/DiD.Rmd")
renderthis::to_html("~/git_projects/KA_slides/DiD/DiD.Rmd")
renderthis::to_pdf("~/git_projects/KA_slides/IV/IV.Rmd")
renderthis::to_html("~/git_projects/KA_slides/IV/IV.Rmd")
renderthis::to_pdf("~/git_projects/KA_slides/RDD/RDD.Rmd")
renderthis::to_html("~/git_projects/KA_slides/RDD/RDD.Rmd")
renderthis::to_pdf("~/git_projects/KA_slides/FurtherTopics/FurtherTopics.Rmd")
renderthis::to_html("~/git_projects/KA_slides/FurtherTopics/FurtherTopics.Rmd")