-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path00_Loop_instit.R
More file actions
53 lines (45 loc) · 2.12 KB
/
00_Loop_instit.R
File metadata and controls
53 lines (45 loc) · 2.12 KB
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
# Loop through Institutional reports
library(rmarkdown)
# Liste der Institutionen
# [1] Université de Lausanne, UNIL Universität Basel, UNIBAS
# [3] Berner Fachhochschule, BFH Universität Luzern, UNILU
# [5] Universität Bern, UNIBE Université de Fribourg / Universität Fribourg, UNIFR
# [7] Eidgenössische Technische Hochschule Zürich, ETH Zürich Universität Zürich, UZH
# [9] Université de Genève, UNIGE Ecole Polytechnique Fédérale de Lausanne, EPFL
# [11] Haute Ecole Spécialisée de Suisse occidentale, HES-SO Université de Neuchâtel, UniNE
# [13] Pädagogische Hochschule Bern, PHBern
# Aus Timons national dokument
# Load data
load("../data/SWiMS2024_Data_2025-09-08.RData")
unique(dat$institution) # sind die 13
object.inst <- levels(dat$institution)
# g <- 7
# Loop über jede Gruppe
# for (g in 6) { # 1:length(object.inst)
#
# if(object.inst[g] == "Eidgenössische Technische Hochschule Zürich, ETH Zürich"){
# obj <- "ETHZ"
# } else {
# obj <- object.inst[g]
# }
#
# render(
# input = "00_Institutional_Report.Rmd", # dein Rmd-Dateipfad
# output_file = paste0("./instit_reports/report_", sub(".*,\\s*", "", obj), ".pdf"), # individuelle Ausgabe
# params = list(object.inst = g), # Übergabe des Parameters
# envir = new.env() # wichtig, um Nebeneffekte zu vermeiden
# )
# }
for (g in 6) { # 1:length(object.inst)
if(object.inst[g] == "Eidgenössische Technische Hochschule Zürich, ETH Zürich"){
obj <- "ETHZ"
} else {
obj <- object.inst[g]
}
render(
input = "00_Institutional_Report_prozente.Rmd", # dein Rmd-Dateipfad
output_file = paste0("./instit_reports/report_percentage_", sub(".*,\\s*", "", obj), ".pdf"), # individuelle Ausgabe
params = list(object.inst = g), # Übergabe des Parameters
envir = new.env() # wichtig, um Nebeneffekte zu vermeiden
)
}