Initial commit

This commit is contained in:
Jonas Karneboge 2026-09-22 18:35:43 +02:00
commit 3cba772836
1341 changed files with 532924 additions and 0 deletions

BIN
TAS26/.RData Normal file

Binary file not shown.

1
TAS26/.Rprofile Normal file
View file

@ -0,0 +1 @@
source("renv/activate.R")

13
TAS26/TAS26.Rproj Normal file
View file

@ -0,0 +1,13 @@
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX

735
TAS26/app.R Normal file
View file

@ -0,0 +1,735 @@
# Präambel ####
AKZENT_FARBE = "#8B2635"
PFAD_DOWNLOAD_SKRIPT = "../API/get_data_tas26.R" # liefert beim Sourcen: daten_tas26
PFAD_PSEUDONYM_SKRIPT = "../get_pseudo.R" # liefert beim Sourcen: pseudo
PFAD_NORMTABELLEN = "normtabellen"
TAS26_HINWEIS_SCHULABSCHLUSS_FEHLT = "Schulabschluss nicht angegeben — differenzierte Norm nicht verfügbar."
TAS26_HINWEIS_T_BAND = "statistischer Durchschnittsbereich (M±1SD), keine klinische Grenze"
# Item-Badges: sequenzielle Farbskala von hell nach Akzentfarbe (Werte 1-5),
# keine Ampel-/Gut-Schlecht-Faerbung, da der TAS-26 kein Klassifikationsschema kennt.
TAS26_BADGE_FARBEN = setNames(
grDevices::colorRampPalette(c("#F2E4E6", AKZENT_FARBE))(5),
as.character(1:5)
)
TAS26_BADGE_TEXT_FARBEN = setNames(
sapply(TAS26_BADGE_FARBEN, function(bg) {
rgb = grDevices::col2rgb(bg)
luminanz = 0.299 * rgb[1] + 0.587 * rgb[2] + 0.114 * rgb[3]
if (luminanz > 150) "#333333" else "white"
}),
as.character(1:5)
)
TAS26_DISCLAIMER = paste0(
"Diese Auswertung ist ein Hilfsmittel für klinisches Fachpersonal und ersetzt keine ",
"klinische Diagnose. Die Interpretation obliegt der behandelnden Person. Für den TAS-26 ",
"liegt kein Cutoff- oder Klassifikationsschema vor; die Werte sind ausschließlich ",
"kontinuierlich (T-Wert, Prozentrang) zu interpretieren."
)
library(shiny)
library(dplyr)
library(ggplot2)
library(haven)
library(officer)
# Infrastruktur ####
APP_VERZEICHNIS = normalizePath(getwd())
absPath = function(pfad) {
if (grepl("^([A-Za-z]:[/\\\\]|/)", pfad)) return(pfad)
file.path(APP_VERZEICHNIS, pfad)
}
PFAD_DOWNLOAD_SKRIPT = normalizePath(absPath(PFAD_DOWNLOAD_SKRIPT), mustWork = FALSE)
PFAD_PSEUDONYM_SKRIPT = normalizePath(absPath(PFAD_PSEUDONYM_SKRIPT), mustWork = FALSE)
PFAD_NORMTABELLEN = normalizePath(absPath(PFAD_NORMTABELLEN), mustWork = FALSE)
# Helper ####
# Prüft anhand des labels-Attributs der ORIGINAL-Itemspalte (vor jedem Subsetting),
# dass Rohwert 1 = "trifft gar nicht zu" und Rohwert 5 = "trifft völlig zu" ist.
# Bricht hart ab statt still in die falsche Richtung zu rekodieren, da eine
# vertauschte Kodierungsrichtung alle Skalensummen unbemerkt verfälschen würde.
tas26_pruefe_kodierungsrichtung = function(spalte) {
labels_attr = attr(spalte, "labels")
if (is.null(labels_attr) || length(labels_attr) == 0) {
stop("TAS-26-Item hat kein labels-Attribut, Kodierungsrichtung kann nicht geprüft werden.")
}
name_bei_1 = names(labels_attr)[as.vector(labels_attr) == 1]
name_bei_5 = names(labels_attr)[as.vector(labels_attr) == 5]
if (length(name_bei_1) == 0 || length(name_bei_5) == 0) {
stop("TAS-26-Item: Werte 1 und/oder 5 nicht im labels-Attribut gefunden.")
}
if (name_bei_1[1] != "trifft gar nicht zu" || name_bei_5[1] != "trifft völlig zu") {
stop(paste0(
"Unerwartete Kodierungsrichtung bei TAS-26-Items: Wert 1 = '", name_bei_1[1],
"', Wert 5 = '", name_bei_5[1], "'. Abbruch, um eine falsche Rekodierung zu vermeiden."
))
}
invisible(TRUE)
}
# Rekodiert (6 - Rohwert) und summiert die Items einer Skala. Bei mindestens
# einer fehlenden Einzelantwort wird die Summe als NA ausgewiesen statt
# stillschweigend durch Mittelwert/0 ersetzt (siehe Abschnitt 3 der Vorgabe).
tas26_berechne_skala = function(skala_def, zeile) {
rohwerte = sapply(skala_def$items, function(var) as.numeric(zeile[[var]][1]))
rekodiert = ifelse(skala_def$invertiert, 6 - rohwerte, rohwerte)
vollstaendig = !any(is.na(rekodiert))
summe = if (vollstaendig) sum(rekodiert) else NA_real_
list(rohwert = summe, vollstaendig = vollstaendig, item_werte = rekodiert)
}
# Entfernt formr-Nummerierungsartefakte am Anfang des Itemtexts (z.B. "4. "),
# die im label-Attribut vor dem eigentlichen Fragetext stehen (siehe Abschnitt 2.1).
tas26_clean_item_label = function(text) {
if (is.null(text) || length(text) == 0 || is.na(text[1])) return(NA_character_)
sub("^\\d+[.)\\s]\\s*", "", trimws(as.character(text[1])))
}
# Baut die Item-Liste einer Skala (Nummer, Text, rekodierter Wert), absteigend
# nach Wert sortiert; Items mit fehlender Antwort (NA) stehen am Ende.
tas26_item_liste = function(skala_def, daten_original, item_werte) {
itemnummern = as.integer(gsub("tas26_", "", skala_def$items))
texte = sapply(skala_def$items, function(var) tas26_clean_item_label(attr(daten_original[[var]], "label")))
df = data.frame(nr = itemnummern, text = texte, wert = as.numeric(item_werte), stringsAsFactors = FALSE)
df[order(df$wert, decreasing = TRUE), ]
}
tas26_berechne_gesamt = function(erg_skalen) {
vollstaendig = all(sapply(erg_skalen, function(e) e$vollstaendig))
summe = if (vollstaendig) sum(sapply(erg_skalen, function(e) e$rohwert)) else NA_real_
list(rohwert = summe, vollstaendig = vollstaendig)
}
# Findet die passende Normtabellen-Zeile. Bei der Gesamtskala deckt die letzte
# Zeile (RW = ">74") alle Rohwerte ab 74 ab, da die Quelle ab dort keine
# feineren Abstufungen mehr liefert (siehe Abschnitt 4 der Vorgabe).
tas26_normzeile = function(tabelle, rohwert, ist_gesamtskala) {
if (is.na(rohwert)) return(NULL)
if (isTRUE(ist_gesamtskala) && rohwert >= 74) {
zeile = tabelle[tabelle$RW == ">74", ]
} else {
zeile = tabelle[tabelle$RW == as.character(rohwert), ]
}
if (nrow(zeile) != 1) {
stop(paste0("Kein eindeutiger Normtabellen-Treffer für Rohwert ", rohwert, "."))
}
zeile
}
tas26_norm_ergebnis = function(skala_def, rohwert, schulabschluss_suffix) {
zeile_a = tas26_normzeile(skala_def$norm_a, rohwert, skala_def$ist_gesamt)
gesamtgruppe = list(z = zeile_a$z[1], T = zeile_a$T[1], PR = zeile_a$PR[1])
schulabschluss = NULL
if (!is.na(schulabschluss_suffix)) {
zeile_b = tas26_normzeile(skala_def$norm_b, rohwert, skala_def$ist_gesamt)
schulabschluss = list(
z = zeile_b[[paste0("z_", schulabschluss_suffix)]][1],
T = zeile_b[[paste0("T_", schulabschluss_suffix)]][1],
PR = zeile_b[[paste0("PR_", schulabschluss_suffix)]][1]
)
}
list(gesamtgruppe = gesamtgruppe, schulabschluss = schulabschluss)
}
tas26_schulabschluss_suffix = function(label) {
if (is.na(label)) return(NA_character_)
switch(as.character(label),
"Hauptschule" = "hauptschule",
"Mittlere Reife/POS" = "mittlere_reife",
"Abitur" = "abitur",
NA_character_
)
}
# Normtabellenwerte enthalten Randwert-Strings wie ">80" oder "<20" (siehe
# Abschnitt 4). Fuer die Marker-Position im Gauge wird nur das Vorzeichen
# entfernt, die angezeigte Beschriftung bleibt der unveraenderte Originaltext.
tas26_t_numerisch = function(t_text) {
if (is.null(t_text) || is.na(t_text)) return(NA_real_)
suppressWarnings(as.numeric(gsub("[<>]", "", t_text)))
}
make_gauge_tas26 = function(t_text) {
t_zahl = tas26_t_numerisch(t_text)
p = ggplot() +
geom_rect(aes(xmin = 40, xmax = 60, ymin = 0, ymax = 1), fill = "#F0F0F0", color = NA) +
geom_rect(aes(xmin = 20, xmax = 85, ymin = 0, ymax = 1), fill = NA, color = "#9E9E9E", linewidth = 0.6) +
geom_vline(xintercept = 40, color = "#9E9E9E", linetype = "dashed", linewidth = 0.7) +
geom_vline(xintercept = 60, color = "#9E9E9E", linetype = "dashed", linewidth = 0.7) +
scale_x_continuous(limits = c(20, 85), breaks = c(20, 30, 40, 50, 60, 70, 80)) +
scale_y_continuous(limits = c(-0.7, 1.6)) +
theme_minimal(base_size = 11) +
theme(
axis.text.y = element_blank(),
axis.ticks.y = element_blank(),
panel.grid.major.y = element_blank(),
panel.grid.minor = element_blank(),
axis.title.y = element_blank(),
plot.background = element_rect(fill = "white", colour = NA),
panel.background = element_rect(fill = "white", colour = NA),
plot.margin = margin(t = 14, r = 10, b = 20, l = 10)
) +
labs(x = "T-Wert", y = NULL) +
annotate("text", x = 52.5, y = -0.55, label = TAS26_HINWEIS_T_BAND,
color = "#777777", size = 2.9, fontface = "italic")
if (!is.na(t_zahl)) {
t_geklemmt = max(20, min(85, t_zahl))
p = p +
geom_segment(aes(x = t_geklemmt, xend = t_geklemmt, y = -0.2, yend = 1.2),
color = AKZENT_FARBE, linewidth = 2.2, lineend = "round") +
annotate("text", x = t_geklemmt, y = 1.4, label = paste0("T = ", t_text),
color = AKZENT_FARBE, fontface = "bold", size = 3.6)
}
p
}
# Datenaufbereitung ####
if (!dir.exists(PFAD_NORMTABELLEN)) {
stop(paste0("Normtabellen-Ordner nicht gefunden: ", PFAD_NORMTABELLEN,
". Bitte die 8 CSV-Dateien in diesen Unterordner legen."))
}
TAS26_NORM_DATEIEN = list(
a_skala1 = "norm_a1_skala1.csv", a_skala2 = "norm_a2_skala2.csv",
a_skala3 = "norm_a3_skala3.csv", a_gesamt = "norm_a4_gesamt.csv",
b_skala1 = "norm_b1_skala1.csv", b_skala2 = "norm_b2_skala2.csv",
b_skala3 = "norm_b3_skala3.csv", b_gesamt = "norm_b4_gesamt.csv"
)
# Alle Spalten als character einlesen, da RW/z/T/PR Randwert-Strings wie
# ">74", ">99" oder "<20" enthalten (siehe Abschnitt 4 der Vorgabe).
tas26_normtabellen = lapply(TAS26_NORM_DATEIEN, function(dateiname) {
pfad = file.path(PFAD_NORMTABELLEN, dateiname)
if (!file.exists(pfad)) stop(paste0("Normtabelle nicht gefunden: ", pfad))
read.csv(pfad, stringsAsFactors = FALSE, colClasses = "character")
})
# 18 von 26 Items werden ausgewertet. Fülleritems (nicht ausgewertet, nirgends
# angezeigt): tas26_01, _02, _05, _06, _07, _16, _18, _19.
TAS26_SKALEN = list(
skala1 = list(
bezeichnung = "Schwierigkeiten bei der Identifikation von Gefühlen",
items = sprintf("tas26_%02d", c(4, 10, 14, 17, 20, 25, 26)),
invertiert = rep(FALSE, 7),
range = c(7, 35),
norm_a = tas26_normtabellen$a_skala1,
norm_b = tas26_normtabellen$b_skala1,
ist_gesamt = FALSE
),
skala2 = list(
bezeichnung = "Schwierigkeiten bei der Beschreibung von Gefühlen",
items = sprintf("tas26_%02d", c(3, 8, 12, 22, 23)),
invertiert = c(FALSE, FALSE, TRUE, FALSE, FALSE),
range = c(5, 25),
norm_a = tas26_normtabellen$a_skala2,
norm_b = tas26_normtabellen$b_skala2,
ist_gesamt = FALSE
),
skala3 = list(
bezeichnung = "Extern orientierter Denkstil",
items = sprintf("tas26_%02d", c(9, 11, 13, 15, 21, 24)),
invertiert = rep(TRUE, 6),
range = c(6, 30),
norm_a = tas26_normtabellen$a_skala3,
norm_b = tas26_normtabellen$b_skala3,
ist_gesamt = FALSE
)
)
TAS26_GESAMT = list(
bezeichnung = "Gesamtskala Alexithymie",
range = c(18, 90),
norm_a = tas26_normtabellen$a_gesamt,
norm_b = tas26_normtabellen$b_gesamt,
ist_gesamt = TRUE
)
# UI ####
app_css = "
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f5f5f5; }
.container-fluid { max-width: 1150px; }
.app-header {
background: #8B2635; color: white; padding: 18px 24px 14px;
margin-bottom: 20px; border-radius: 0 0 6px 6px;
}
.app-header h2 { margin: 0; font-size: 1.5rem; font-weight: 600; }
.app-header p { margin: 4px 0 0; opacity: 0.85; font-size: 0.9rem; }
.input-panel {
background: white; border-radius: 6px; padding: 16px 20px;
margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.12);
display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
}
.input-panel .form-group { margin-bottom: 0; }
.input-panel label { font-weight: 600; color: #333; }
.btn-laden {
background: #8B2635 !important; color: white !important;
border: none !important; border-radius: 4px !important;
padding: 8px 20px !important; font-weight: 600 !important; cursor: pointer;
}
.btn-laden:hover { background: #6d1e29 !important; }
#download_word {
background: #8B2635 !important; color: white !important; border: none !important;
font-weight: 600 !important; padding: 8px 20px !important; border-radius: 4px !important;
}
#download_word:hover { background: #6d1e29 !important; }
.alert-fehler {
background: #FFEBEE; border-left: 5px solid #C62828;
padding: 12px 16px; border-radius: 4px; color: #B71C1C;
margin-bottom: 12px; font-weight: 500;
}
.alert-warnung {
background: #FFF3E0; border-left: 5px solid #E65100;
padding: 10px 16px; border-radius: 4px; color: #BF360C;
margin-bottom: 12px; font-size: 0.93em; font-weight: 500;
}
.abschnitt-karte {
background: white; border-radius: 6px; padding: 20px 24px;
margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.abschnitt-titel {
color: #8B2635; font-size: 1.15rem; font-weight: 700;
border-bottom: 2px solid #8B2635; padding-bottom: 8px; margin-bottom: 14px;
}
.meta-block { margin-bottom: 10px; color: #555; font-size: 0.95em; }
.meta-block strong { color: #222; }
.skala-block { padding: 14px 0; border-bottom: 1px solid #eee; }
.skala-block:last-child { border-bottom: none; }
.skala-kopf { font-weight: 700; color: #333; font-size: 1rem; margin-bottom: 8px; }
.skala-kopf .rohwert { color: #8B2635; font-weight: 700; }
.normwert-tabelle { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 0.9em; }
.normwert-tabelle th, .normwert-tabelle td { text-align: left; padding: 4px 10px; border-bottom: 1px solid #f0f0f0; }
.normwert-tabelle th { color: #555; font-weight: 600; }
.hinweis-block { font-size: 0.82em; color: #777; font-style: italic; margin: 6px 0 4px; }
.item-liste { margin-bottom: 10px; }
.item-zeile {
display: flex; align-items: flex-start; gap: 10px;
padding: 5px 0; border-bottom: 1px solid #F5F5F5;
}
.item-nr { font-weight: 600; color: #8B2635; min-width: 22px; flex-shrink: 0; }
.item-text { flex: 1; color: #333; font-size: 0.9em; }
.item-badge {
border-radius: 4px; padding: 2px 10px; font-weight: 700;
font-size: 0.82em; white-space: nowrap; display: inline-block; flex-shrink: 0;
}
.unvollstaendig-block {
background: #FFF3E0; border-left: 4px solid #E65100;
padding: 8px 12px; border-radius: 4px; color: #BF360C; font-size: 0.92em;
}
"
app_css = gsub("#8B2635", AKZENT_FARBE, app_css, fixed = TRUE)
ui = fluidPage(
tags$head(
tags$meta(charset = "UTF-8"),
tags$style(HTML(app_css))
),
div(class = "app-header",
tags$h2("TAS-26 Toronto-Alexithymie-Skala"),
tags$p("deutsche Version, Kupfer/Brosig/Brähler 2001")
),
div(class = "container-fluid",
div(class = "input-panel",
div(style = "min-width: 360px; white-space: nowrap;",
textInput("pseudonym",
label = tagList(
"Pseudonym",
tags$span(style = "font-weight: normal; font-style: italic; font-size: 0.78em; color: #888; margin-left: 4px; white-space: nowrap;",
"optional, hat Vorrang vor Chiffre")
),
placeholder = "optional", width = "340px")
),
div(style = "min-width: 200px;",
textInput("chiffre", label = "Patientenchiffre",
placeholder = "z.B. P000123", width = "100%")
),
actionButton("btn_suchen", "Auswerten", class = "btn btn-primary btn-laden"),
div(style = "margin-left: auto;",
downloadButton("download_word", "Word-Export (.docx)")
)
),
uiOutput("fehler_ui"),
uiOutput("warnung_ui"),
uiOutput("ergebnis_ui")
)
)
# Word-Export ####
erstelle_tas26_docx = function(d) {
doc = read_docx()
fp_titel = fp_text(color = AKZENT_FARBE, bold = TRUE, font.size = 18)
fp_abschnitt = fp_text(color = AKZENT_FARBE, bold = TRUE, font.size = 13)
fp_label = fp_text(bold = TRUE, font.size = 11)
fp_normal = fp_text(font.size = 11)
fp_disclaimer = fp_text(font.size = 9, italic = TRUE, color = "#777777")
doc = body_add_fpar(doc, fpar(ftext("TAS-26 — Auswertung", fp_titel)))
doc = body_add_fpar(doc, fpar(
ftext("Chiffre: ", fp_label), ftext(d$chiffre, fp_normal),
ftext(" Datum: ", fp_label), ftext(d$datum_str, fp_normal)
))
if (!is.null(d$info_mehrere)) {
doc = body_add_fpar(doc, fpar(
ftext(d$info_mehrere, fp_text(font.size = 10, italic = TRUE, color = "#555555"))
))
}
doc = body_add_par(doc, "", style = "Normal")
doc = body_add_fpar(doc, fpar(ftext("Übersicht", fp_abschnitt)))
hole_wert = function(sk, feld, gruppe) {
if (!sk$vollstaendig) return("-")
if (gruppe == "schulabschluss" && is.null(sk$norm$schulabschluss)) return("-")
sk$norm[[gruppe]][[feld]]
}
tbl_df = data.frame(
Skala = sapply(d$skalen, function(sk) sk$titel),
Rohwert = sapply(d$skalen, function(sk) if (sk$vollstaendig) as.character(sk$rohwert) else "nicht auswertbar"),
`T (Gesamtgruppe)` = sapply(d$skalen, function(sk) hole_wert(sk, "T", "gesamtgruppe")),
`PR (Gesamtgruppe)` = sapply(d$skalen, function(sk) hole_wert(sk, "PR", "gesamtgruppe")),
`T (Schulabschluss)` = sapply(d$skalen, function(sk) hole_wert(sk, "T", "schulabschluss")),
`PR (Schulabschluss)` = sapply(d$skalen, function(sk) hole_wert(sk, "PR", "schulabschluss")),
check.names = FALSE, stringsAsFactors = FALSE
)
tabellenstile_vorhanden = styles_info(doc)
tabellenstile_vorhanden = tabellenstile_vorhanden[tabellenstile_vorhanden$style_type == "table", "style_name"]
if ("Table Grid" %in% tabellenstile_vorhanden) {
doc = body_add_table(doc, tbl_df, style = "Table Grid")
} else {
doc = body_add_table(doc, tbl_df)
}
doc = body_add_par(doc, "", style = "Normal")
doc = body_add_fpar(doc, fpar(ftext(TAS26_DISCLAIMER, fp_disclaimer)))
doc
}
# Server ####
server = function(input, output, session) {
observe({
query = parseQueryString(session$clientData$url_search)
if (!is.null(query$pseudonym) && nchar(trimws(query$pseudonym)) > 0) {
updateTextInput(session, "pseudonym", value = trimws(query$pseudonym))
}
})
observe({
query = parseQueryString(session$clientData$url_search)
if (!is.null(query$chiffre) && nchar(trimws(query$chiffre)) > 0) {
updateTextInput(session, "chiffre", value = toupper(trimws(query$chiffre)))
}
})
# Skripte werden NICHT beim App-Start gesourct, nur beim Klick.
ergebnis_r = eventReactive(input$btn_suchen, {
chiffre = toupper(trimws(input$chiffre))
if (nchar(trimws(input$pseudonym)) == 0 && nchar(chiffre) == 0) {
return(list(error = "Bitte Chiffre oder Pseudonym eingeben."))
}
if (nchar(trimws(input$pseudonym)) == 0 && !grepl("^[A-Z][0-9]{6}$", chiffre)) {
return(list(error = "Ungültige Chiffre. Erwartet: ein Großbuchstabe + 6 Ziffern (z.B. P000123)."))
}
if (!file.exists(PFAD_DOWNLOAD_SKRIPT)) {
return(list(error = paste0("Download-Skript nicht gefunden:\n", PFAD_DOWNLOAD_SKRIPT)))
}
if (!file.exists(PFAD_PSEUDONYM_SKRIPT)) {
return(list(error = paste0("Pseudonym-Skript nicht gefunden:\n", PFAD_PSEUDONYM_SKRIPT)))
}
res_dl = tryCatch(
{ source(PFAD_DOWNLOAD_SKRIPT, local = FALSE); list(ok = TRUE) },
error = function(e) list(ok = FALSE, msg = e$message)
)
if (!res_dl$ok) return(list(error = paste0("Fehler im Download-Skript: ", res_dl$msg)))
db_ordner = local({
ordner = dirname(normalizePath(PFAD_PSEUDONYM_SKRIPT, mustWork = FALSE))
gefunden = NULL
for (i in 1:5) {
if (file.exists(file.path(ordner, "pseudonyme.db"))) {
gefunden = ordner
break
}
elternteil = dirname(ordner)
if (elternteil == ordner) break
ordner = elternteil
}
gefunden
})
alter_wd = getwd()
wd_ziel = if (!is.null(db_ordner)) db_ordner else
dirname(normalizePath(PFAD_PSEUDONYM_SKRIPT, mustWork = FALSE))
setwd(wd_ziel)
on.exit(setwd(alter_wd), add = TRUE)
res_ps = tryCatch(
{ source(PFAD_PSEUDONYM_SKRIPT, local = FALSE)
if (nchar(trimws(input$pseudonym)) > 0) {
.pw_wert = trimws(input$pseudonym)
.pw_tab = get("pseudo", envir = .GlobalEnv)
.pw_treffer = .pw_tab[.pw_tab$pseudonym == .pw_wert, ]
if (nrow(.pw_treffer) > 0) chiffre = toupper(trimws(.pw_treffer$chiffre[1]))
}; list(ok = TRUE) },
error = function(e) list(ok = FALSE, msg = e$message)
)
if (!res_ps$ok) return(list(error = paste0("Fehler im Pseudonym-Skript: ", res_ps$msg)))
if (!exists("daten_tas26", envir = .GlobalEnv)) {
return(list(error = "Objekt 'daten_tas26' nach dem Sourcen nicht gefunden. Bitte Download-Skript prüfen."))
}
if (!exists("pseudo", envir = .GlobalEnv)) {
return(list(error = "Objekt 'pseudo' nach dem Sourcen nicht gefunden. Bitte Pseudonym-Skript prüfen."))
}
daten = get("daten_tas26", envir = .GlobalEnv)
pseudo_df = get("pseudo", envir = .GlobalEnv)
kodierung_ok = tryCatch(
{ tas26_pruefe_kodierungsrichtung(daten[["tas26_01"]]); list(ok = TRUE) },
error = function(e) list(ok = FALSE, msg = e$message)
)
if (!kodierung_ok$ok) return(list(error = kodierung_ok$msg))
# Eine Chiffre kann mehrere Pseudonyme haben (eines pro Instrument/Run).
treffer_ps = pseudo_df[pseudo_df$chiffre == chiffre, ]
if (nrow(treffer_ps) == 0) {
return(list(error = paste0("Chiffre '", chiffre, "' wurde in der Pseudonym-Datenbank nicht gefunden.")))
}
alle_session_ids = unique(treffer_ps$pseudonym)
if (nchar(trimws(input$pseudonym)) > 0) alle_session_ids = trimws(input$pseudonym)
treffer_dat = daten[daten$session %in% alle_session_ids, ]
if (nrow(treffer_dat) == 0) {
return(list(error = paste0(
"Kein TAS-26-Datensatz für Chiffre '", chiffre, "' gefunden. ",
"(", length(alle_session_ids), " Pseudonym(e) geprüft)"
)))
}
info_mehrere = NULL
if (nrow(treffer_dat) > 1) {
n = nrow(treffer_dat)
treffer_dat = treffer_dat[order(treffer_dat$created, decreasing = TRUE), ]
datum_neu = tryCatch(
format(as.POSIXct(treffer_dat$created[1]), "%d.%m.%Y %H:%M"),
error = function(e) "unbekanntes Datum"
)
info_mehrere = paste0(
"Mehrere Ausfüllungen gefunden (", n, " Einträge). ",
"Angezeigt wird die neueste vom ", datum_neu, "."
)
treffer_dat = treffer_dat[1, , drop = FALSE]
}
zeile = treffer_dat[1, , drop = FALSE]
ausfuelldatum = tryCatch(as.Date(as.POSIXct(zeile[["created"]][1])), error = function(e) Sys.Date())
datum_str = tryCatch(format(ausfuelldatum, "%d.%m.%Y"), error = function(e) format(Sys.Date(), "%d.%m.%Y"))
schulabschluss_label = NA_character_
if ("tas26_schulabschluss" %in% colnames(daten)) {
schulabschluss_faktor = haven::as_factor(zeile[["tas26_schulabschluss"]])
schulabschluss_label = as.character(schulabschluss_faktor[1])
}
schulabschluss_suffix = tas26_schulabschluss_suffix(schulabschluss_label)
erg_skalen_roh = lapply(TAS26_SKALEN, function(sk_def) tas26_berechne_skala(sk_def, zeile))
erg_gesamt_roh = tas26_berechne_gesamt(erg_skalen_roh)
skalen = list()
for (key in names(TAS26_SKALEN)) {
sk_def = TAS26_SKALEN[[key]]
roh = erg_skalen_roh[[key]]
norm = if (roh$vollstaendig) tas26_norm_ergebnis(sk_def, roh$rohwert, schulabschluss_suffix) else NULL
items = tas26_item_liste(sk_def, daten, roh$item_werte)
skalen[[key]] = list(
key = key, titel = sk_def$bezeichnung, range = sk_def$range,
rohwert = roh$rohwert, vollstaendig = roh$vollstaendig, norm = norm, items = items
)
}
norm_gesamt = if (erg_gesamt_roh$vollstaendig)
tas26_norm_ergebnis(TAS26_GESAMT, erg_gesamt_roh$rohwert, schulabschluss_suffix) else NULL
skalen[["gesamt"]] = list(
key = "gesamt", titel = TAS26_GESAMT$bezeichnung, range = TAS26_GESAMT$range,
rohwert = erg_gesamt_roh$rohwert, vollstaendig = erg_gesamt_roh$vollstaendig, norm = norm_gesamt, items = NULL
)
list(
chiffre = chiffre,
datum_str = datum_str,
ausfuelldatum = ausfuelldatum,
info_mehrere = info_mehrere,
schulabschluss_label = schulabschluss_label,
skalen = skalen,
error = NULL
)
})
output$fehler_ui = renderUI({
req(input$btn_suchen)
d = ergebnis_r()
if (!is.null(d$error)) div(class = "alert-fehler", d$error)
})
output$warnung_ui = renderUI({
req(input$btn_suchen)
d = ergebnis_r()
if (!is.null(d$error) || is.null(d$info_mehrere)) return(NULL)
div(class = "alert-warnung", d$info_mehrere)
})
output$ergebnis_ui = renderUI({
req(input$btn_suchen)
d = ergebnis_r()
if (!is.null(d$error)) return(NULL)
reihenfolge = c("gesamt", "skala1", "skala2", "skala3")
skala_blocke = lapply(d$skalen[reihenfolge], function(sk) {
div(class = "skala-block",
div(class = "skala-kopf",
paste0(sk$titel, " — Rohwert "),
if (sk$vollstaendig)
span(class = "rohwert", paste0(sk$rohwert, " von ", sk$range[1], "", sk$range[2]))
else
span(class = "rohwert", "nicht auswertbar")
),
if (!sk$vollstaendig) {
div(class = "unvollstaendig-block", "Skala nicht vollständig beantwortet, keine Auswertung möglich.")
} else {
tagList(
plotOutput(paste0("gauge_", sk$key), height = "150px"),
tags$table(class = "normwert-tabelle",
tags$tr(tags$th(""), tags$th("z-Wert"), tags$th("T-Wert"), tags$th("Prozentrang")),
tags$tr(
tags$td("Gesamtgruppe"),
tags$td(sk$norm$gesamtgruppe$z), tags$td(sk$norm$gesamtgruppe$T), tags$td(sk$norm$gesamtgruppe$PR)
),
if (!is.null(sk$norm$schulabschluss))
tags$tr(
tags$td("Schulabschluss-differenziert"),
tags$td(sk$norm$schulabschluss$z), tags$td(sk$norm$schulabschluss$T), tags$td(sk$norm$schulabschluss$PR)
)
),
if (is.null(sk$norm$schulabschluss))
div(class = "hinweis-block", TAS26_HINWEIS_SCHULABSCHLUSS_FEHLT)
)
},
if (!is.null(sk$items)) {
div(class = "item-liste",
lapply(seq_len(nrow(sk$items)), function(i) {
zeile_item = sk$items[i, ]
wert_key = if (!is.na(zeile_item$wert)) as.character(zeile_item$wert) else NA_character_
bg_farbe = if (!is.na(wert_key)) TAS26_BADGE_FARBEN[[wert_key]] else "#E0E0E0"
txt_farbe = if (!is.na(wert_key)) TAS26_BADGE_TEXT_FARBEN[[wert_key]] else "#666666"
div(class = "item-zeile",
div(class = "item-nr", paste0(zeile_item$nr, ".")),
div(class = "item-text", if (!is.na(zeile_item$text)) zeile_item$text else paste0("Item ", zeile_item$nr)),
span(class = "item-badge",
style = paste0("background:", bg_farbe, "; color:", txt_farbe, ";"),
if (!is.na(zeile_item$wert)) zeile_item$wert else "k. A.")
)
})
)
}
)
})
div(class = "abschnitt-karte",
div(class = "abschnitt-titel", "TAS-26 Auswertung"),
div(class = "meta-block",
tags$strong("Chiffre: "), d$chiffre,
tags$span(" | ", style = "color:#ccc;"),
tags$strong("Ausfülldatum: "), d$datum_str
),
tags$hr(),
skala_blocke
)
})
for (sk_key in c(names(TAS26_SKALEN), "gesamt")) {
local({
key_lokal = sk_key
output[[paste0("gauge_", key_lokal)]] = renderPlot({
d = ergebnis_r()
req(is.null(d$error))
e = d$skalen[[key_lokal]]
req(e$vollstaendig)
make_gauge_tas26(e$norm$gesamtgruppe$T)
}, bg = "transparent")
})
}
output$download_word = downloadHandler(
filename = function() {
d = tryCatch(ergebnis_r(), error = function(e) NULL)
chiffre = if (is.list(d) && is.null(d$error) && nchar(d$chiffre) > 0) d$chiffre else "export"
datum = if (is.list(d) && is.null(d$error) && !is.null(d$ausfuelldatum))
tryCatch(format(d$ausfuelldatum, "%Y%m%d"), error = function(e) format(Sys.Date(), "%Y%m%d"))
else
format(Sys.Date(), "%Y%m%d")
paste0("TAS26_", chiffre, "_", datum, ".docx")
},
content = function(file) {
d = tryCatch(ergebnis_r(), error = function(e) NULL)
daten_ok = is.list(d) && is.null(d$error)
if (!daten_ok) {
doc = read_docx()
doc = body_add_par(doc,
"Kein Datensatz geladen. Bitte zuerst Chiffre oder Pseudonym eingeben und 'Auswerten' klicken.",
style = "Normal")
print(doc, target = file)
return()
}
doc = tryCatch(
erstelle_tas26_docx(d),
error = function(e) {
err_doc = read_docx()
body_add_par(err_doc,
paste0("Fehler beim Erstellen des Word-Dokuments: ", e$message),
style = "Normal")
}
)
print(doc, target = file)
}
)
}
# Start ####
shinyApp(ui, server)

View file

@ -0,0 +1,30 @@
RW,RW_n,z,T,PR
7,1.00,-1.33,37,11
8,1.14,-1.14,39,17
9,1.29,-0.95,40,25
10,1.43,-0.77,42,32
11,1.57,-0.58,44,38
12,1.71,-0.40,46,44
13,1.86,-0.21,48,49
14,2.00,-0.02,50,55
15,2.14,.16,52,62
16,2.29,.34,53,66
17,2.43,.53,55,71
18,2.57,.71,57,76
19,2.71,.90,59,81
20,2.86,1.09,61,85
21,3.00,1.27,63,89
22,3.14,1.46,65,92
23,3.29,1.65,66,94
24,3.43,1.83,68,96
25,3.57,2.02,70,98
26,3.71,2.20,72,98
27,3.86,2.39,74,99
28,4.00,2.58,76,>99
29,4.14,2.76,78,>99
30,4.29,2.95,79,>99
31,4.43,>3.0,80,>99
32,4.57,>3.0,80,>99
33,4.71,>3.0,80,>99
34,4.86,>3.0,80,>99
35,5.00,>3.0,80,>99
1 RW RW_n z T PR
2 7 1.00 -1.33 37 11
3 8 1.14 -1.14 39 17
4 9 1.29 -0.95 40 25
5 10 1.43 -0.77 42 32
6 11 1.57 -0.58 44 38
7 12 1.71 -0.40 46 44
8 13 1.86 -0.21 48 49
9 14 2.00 -0.02 50 55
10 15 2.14 .16 52 62
11 16 2.29 .34 53 66
12 17 2.43 .53 55 71
13 18 2.57 .71 57 76
14 19 2.71 .90 59 81
15 20 2.86 1.09 61 85
16 21 3.00 1.27 63 89
17 22 3.14 1.46 65 92
18 23 3.29 1.65 66 94
19 24 3.43 1.83 68 96
20 25 3.57 2.02 70 98
21 26 3.71 2.20 72 98
22 27 3.86 2.39 74 99
23 28 4.00 2.58 76 >99
24 29 4.14 2.76 78 >99
25 30 4.29 2.95 79 >99
26 31 4.43 >3.0 80 >99
27 32 4.57 >3.0 80 >99
28 33 4.71 >3.0 80 >99
29 34 4.86 >3.0 80 >99
30 35 5.00 >3.0 80 >99

View file

@ -0,0 +1,22 @@
RW,RW_n,z,T,PR
5,1.0,-2.10,29,2
6,1.2,-1.83,32,4
7,1.4,-1.57,34,8
8,1.6,-1.31,37,12
9,1.8,-1.05,39,20
10,2.0,-.78,42,26
11,2.2,-.52,45,35
12,2.4,-.26,47,43
13,2.6,.01,50,54
14,2.8,.27,53,64
15,3.0,.53,55,75
16,3.2,.79,58,83
17,3.4,1.06,61,88
18,3.6,1.32,63,92
19,3.8,1.58,66,95
20,4.0,1.84,68,97
21,4.2,2.11,71,98
22,4.4,2.37,74,99
23,4.6,2.63,76,>99
24,4.8,2.90,79,>99
25,5.0,3.16,82,>99
1 RW RW_n z T PR
2 5 1.0 -2.10 29 2
3 6 1.2 -1.83 32 4
4 7 1.4 -1.57 34 8
5 8 1.6 -1.31 37 12
6 9 1.8 -1.05 39 20
7 10 2.0 -.78 42 26
8 11 2.2 -.52 45 35
9 12 2.4 -.26 47 43
10 13 2.6 .01 50 54
11 14 2.8 .27 53 64
12 15 3.0 .53 55 75
13 16 3.2 .79 58 83
14 17 3.4 1.06 61 88
15 18 3.6 1.32 63 92
16 19 3.8 1.58 66 95
17 20 4.0 1.84 68 97
18 21 4.2 2.11 71 98
19 22 4.4 2.37 74 99
20 23 4.6 2.63 76 >99
21 24 4.8 2.90 79 >99
22 25 5.0 3.16 82 >99

View file

@ -0,0 +1,26 @@
RW,RW_n,z,T,PR
6,1.00,-2.58,24,0
7,1.17,-2.34,27,1
8,2.33,-2.09,29,2
9,1.50,-1.84,32,4
10,1.67,-1.59,34,7
11,1.83,-1.34,37,11
12,2.00,-1.09,39,16
13,2.17,-.85,42,22
14,2.33,-.60,44,30
15,2.50,-.35,47,39
16,2.67,-.10,49,50
17,2.83,.15,51,60
18,3.00,.40,54,71
19,3.17,.65,56,79
20,3.33,.89,59,85
21,3.50,1.14,61,89
22,3.67,1.39,64,93
23,3.83,1.64,66,96
24,4.00,1.89,69,97
25,4.17,2.14,71,98
26,4.33,2.38,74,99
27,4.50,2.63,76,>99
28,4.67,2.88,79,>99
29,4.83,3.13,81,>99
30,5.00,>3.13,84,>99
1 RW RW_n z T PR
2 6 1.00 -2.58 24 0
3 7 1.17 -2.34 27 1
4 8 2.33 -2.09 29 2
5 9 1.50 -1.84 32 4
6 10 1.67 -1.59 34 7
7 11 1.83 -1.34 37 11
8 12 2.00 -1.09 39 16
9 13 2.17 -.85 42 22
10 14 2.33 -.60 44 30
11 15 2.50 -.35 47 39
12 16 2.67 -.10 49 50
13 17 2.83 .15 51 60
14 18 3.00 .40 54 71
15 19 3.17 .65 56 79
16 20 3.33 .89 59 85
17 21 3.50 1.14 61 89
18 22 3.67 1.39 64 93
19 23 3.83 1.64 66 96
20 24 4.00 1.89 69 97
21 25 4.17 2.14 71 98
22 26 4.33 2.38 74 99
23 27 4.50 2.63 76 >99
24 28 4.67 2.88 79 >99
25 29 4.83 3.13 81 >99
26 30 5.00 >3.13 84 >99

View file

@ -0,0 +1,58 @@
RW,RW_n,z,T,PR
18,1.00,-2.68,23,0
19,1.06,-2.57,24,0
20,1.11,-2.47,25,0
21,1.17,-2.36,26,0
22,1.22,-2.26,27,1
23,1.28,-2.15,28,1
24,1.33,-2.05,30,2
25,1.39,-1.94,31,3
26,1.44,-1.84,32,4
27,1.50,-1.73,33,4
28,1.56,-1.63,34,5
29,1.61,-1.52,35,7
30,1.67,-1.42,36,9
31,1.72,-1.31,37,11
32,1.78,-1.21,38,13
33,1.83,-1.10,39,16
34,1.89,-1.00,40,19
35,1.94,-.89,41,22
36,2.00,-.79,42,25
37,2.06,-.68,43,28
38,2.11,-.58,44,31
39,2.17,-.47,45,34
40,2.22,-.37,46,38
41,2.28,-.26,47,41
42,2.33,-.16,48,46
43,2.39,-.05,49,49
44,2.44,.05,51,53
45,2.50,.16,52,56
46,2.56,.26,53,60
47,2.61,.37,54,63
48,2.67,.47,55,66
49,2.72,.58,56,70
50,2.78,.68,57,73
51,2.83,.79,58,76
52,2.89,.89,59,80
53,2.94,1.00,60,83
54,3.00,1.10,61,87
55,3.06,1.21,62,89
56,3.11,1.31,63,92
57,3.17,1.42,64,94
58,3.22,1.52,65,95
59,3.28,1.63,66,97
60,3.33,1.73,67,98
61,3.39,1.84,68,98
62,3.44,1.94,69,98
63,3.50,2.05,70,99
64,3.56,2.15,72,>99
65,3.61,2.26,73,>99
66,3.67,2.36,74,>99
67,3.72,2.47,75,>99
68,3.78,2.57,76,>99
69,3.83,2.68,77,>99
70,3.89,2.78,78,>99
71,3.94,2.89,79,>99
72,4.00,2.99,80,>99
73,4.06,3.10,>80,>99
>74,4.11,>3.10,>80,>99
1 RW RW_n z T PR
2 18 1.00 -2.68 23 0
3 19 1.06 -2.57 24 0
4 20 1.11 -2.47 25 0
5 21 1.17 -2.36 26 0
6 22 1.22 -2.26 27 1
7 23 1.28 -2.15 28 1
8 24 1.33 -2.05 30 2
9 25 1.39 -1.94 31 3
10 26 1.44 -1.84 32 4
11 27 1.50 -1.73 33 4
12 28 1.56 -1.63 34 5
13 29 1.61 -1.52 35 7
14 30 1.67 -1.42 36 9
15 31 1.72 -1.31 37 11
16 32 1.78 -1.21 38 13
17 33 1.83 -1.10 39 16
18 34 1.89 -1.00 40 19
19 35 1.94 -.89 41 22
20 36 2.00 -.79 42 25
21 37 2.06 -.68 43 28
22 38 2.11 -.58 44 31
23 39 2.17 -.47 45 34
24 40 2.22 -.37 46 38
25 41 2.28 -.26 47 41
26 42 2.33 -.16 48 46
27 43 2.39 -.05 49 49
28 44 2.44 .05 51 53
29 45 2.50 .16 52 56
30 46 2.56 .26 53 60
31 47 2.61 .37 54 63
32 48 2.67 .47 55 66
33 49 2.72 .58 56 70
34 50 2.78 .68 57 73
35 51 2.83 .79 58 76
36 52 2.89 .89 59 80
37 53 2.94 1.00 60 83
38 54 3.00 1.10 61 87
39 55 3.06 1.21 62 89
40 56 3.11 1.31 63 92
41 57 3.17 1.42 64 94
42 58 3.22 1.52 65 95
43 59 3.28 1.63 66 97
44 60 3.33 1.73 67 98
45 61 3.39 1.84 68 98
46 62 3.44 1.94 69 98
47 63 3.50 2.05 70 99
48 64 3.56 2.15 72 >99
49 65 3.61 2.26 73 >99
50 66 3.67 2.36 74 >99
51 67 3.72 2.47 75 >99
52 68 3.78 2.57 76 >99
53 69 3.83 2.68 77 >99
54 70 3.89 2.78 78 >99
55 71 3.94 2.89 79 >99
56 72 4.00 2.99 80 >99
57 73 4.06 3.10 >80 >99
58 >74 4.11 >3.10 >80 >99

View file

@ -0,0 +1,30 @@
RW,RW_n,z_hauptschule,T_hauptschule,PR_hauptschule,z_mittlere_reife,T_mittlere_reife,PR_mittlere_reife,z_abitur,T_abitur,PR_abitur
7,1.00,-1.48,35,9,-1.17,38,16,-1.23,38,15
8,1.14,-1.30,37,14,-.99,40,23,-1.05,40,22
9,1.29,-1.12,39,20,-.80,42,34,-.86,41,28
10,1.43,-.94,41,26,-.61,44,43,-.67,43,36
11,1.57,-.75,43,32,-.42,46,48,-.48,45,42
12,1.71,-.57,44,38,-.24,48,53,-.29,47,49
13,1.86,-.39,46,43,-.05,50,57,-.10,49,56
14,2.00,-.21,48,49,.14,51,61,.09,51,63
15,2.14,-.03,50,56,.32,53,68,.27,53,67
16,2.29,.16,52,65,.42,54,73,.46,55,70
17,2.43,.34,53,70,.51,55,74,.65,57,76
18,2.57,.52,55,75,.70,57,77,.84,58,79
19,2.71,.70,57,81,.89,59,81,1.03,60,84
20,2.86,.88,59,83,1.07,61,84,1.21,62,90
21,3.00,1.07,61,86,1.26,63,87,1.40,64,93
22,3.14,1.25,63,90,1.45,65,91,1.59,66,95
23,3.29,1.43,64,93,1.63,66,95,1.78,68,97
24,3.43,1.61,66,96,1.82,68,96,1.97,70,97
25,3.57,1.79,68,98,2.01,70,98,2.16,72,98
26,3.71,1.98,70,99,2.20,72,99,2.34,73,98
27,3.86,2.16,72,>99,2.38,74,>99,2.53,75,99
28,4.00,2.34,73,>99,2.57,76,>99,2.72,77,>99
29,4.14,2.52,75,>99,2.76,78,>99,2.91,79,>99
30,4.29,2.70,77,>99,2.95,80,>99,>3.00,>80,>99
31,4.43,2.89,79,>99,>3.00,>80,>99,>3.00,>80,>99
32,4.57,>3.00,>80,>99,>3.02,>80,>99,>3.00,>80,>99
33,4.71,>3.00,>80,>99,>3.02,>80,>99,>3.00,>80,>99
34,4.86,>3.00,>80,>99,>3.02,>80,>99,>3.00,>80,>99
35,5.00,>3.00,>80,>99,>3.02,>80,>99,>3.00,>80,>99
1 RW RW_n z_hauptschule T_hauptschule PR_hauptschule z_mittlere_reife T_mittlere_reife PR_mittlere_reife z_abitur T_abitur PR_abitur
2 7 1.00 -1.48 35 9 -1.17 38 16 -1.23 38 15
3 8 1.14 -1.30 37 14 -.99 40 23 -1.05 40 22
4 9 1.29 -1.12 39 20 -.80 42 34 -.86 41 28
5 10 1.43 -.94 41 26 -.61 44 43 -.67 43 36
6 11 1.57 -.75 43 32 -.42 46 48 -.48 45 42
7 12 1.71 -.57 44 38 -.24 48 53 -.29 47 49
8 13 1.86 -.39 46 43 -.05 50 57 -.10 49 56
9 14 2.00 -.21 48 49 .14 51 61 .09 51 63
10 15 2.14 -.03 50 56 .32 53 68 .27 53 67
11 16 2.29 .16 52 65 .42 54 73 .46 55 70
12 17 2.43 .34 53 70 .51 55 74 .65 57 76
13 18 2.57 .52 55 75 .70 57 77 .84 58 79
14 19 2.71 .70 57 81 .89 59 81 1.03 60 84
15 20 2.86 .88 59 83 1.07 61 84 1.21 62 90
16 21 3.00 1.07 61 86 1.26 63 87 1.40 64 93
17 22 3.14 1.25 63 90 1.45 65 91 1.59 66 95
18 23 3.29 1.43 64 93 1.63 66 95 1.78 68 97
19 24 3.43 1.61 66 96 1.82 68 96 1.97 70 97
20 25 3.57 1.79 68 98 2.01 70 98 2.16 72 98
21 26 3.71 1.98 70 99 2.20 72 99 2.34 73 98
22 27 3.86 2.16 72 >99 2.38 74 >99 2.53 75 99
23 28 4.00 2.34 73 >99 2.57 76 >99 2.72 77 >99
24 29 4.14 2.52 75 >99 2.76 78 >99 2.91 79 >99
25 30 4.29 2.70 77 >99 2.95 80 >99 >3.00 >80 >99
26 31 4.43 2.89 79 >99 >3.00 >80 >99 >3.00 >80 >99
27 32 4.57 >3.00 >80 >99 >3.02 >80 >99 >3.00 >80 >99
28 33 4.71 >3.00 >80 >99 >3.02 >80 >99 >3.00 >80 >99
29 34 4.86 >3.00 >80 >99 >3.02 >80 >99 >3.00 >80 >99
30 35 5.00 >3.00 >80 >99 >3.02 >80 >99 >3.00 >80 >99

View file

@ -0,0 +1,22 @@
RW,RW_n,z_hauptschule,T_hauptschule,PR_hauptschule,z_mittlere_reife,T_mittlere_reife,PR_mittlere_reife,z_abitur,T_abitur,PR_abitur
5,1.0,-2.28,27,1,-2.02,30,3,-1.76,32,2
6,1.2,-2.01,30,2,-1.75,32,8,-1.51,35,6
7,1.4,-1.74,33,6,-1.49,35,11,-1.26,37,15
8,1.6,-1.46,35,11,-1.22,38,16,-1.01,40,21
9,1.8,-1.19,38,17,-.96,40,23,-.76,42,31
10,2.0,-.92,41,23,-.69,43,27,-.51,45,41
11,2.2,-.65,43,31,-.43,46,37,-.25,48,50
12,2.4,-.37,46,40,-.16,48,47,.00,50,57
13,2.6,-.10,49,52,.10,50,59,.25,53,65
14,2.8,.17,52,62,.37,54,69,.50,55,74
15,3.0,.44,54,72,.64,56,78,.75,58,79
16,3.2,.72,57,82,.90,59,84,1.00,60,88
17,3.4,.99,60,88,1.17,62,91,1.25,63,91
18,3.6,1.26,63,92,1.43,64,96,1.50,65,94
19,3.8,1.53,65,95,1.70,67,98,1.76,68,96
20,4.0,1.81,68,97,1.96,70,99,2.01,70,98
21,4.2,2.09,71,99,2.23,72,>99,2.26,73,99
22,4.4,2.35,74,>99,2.49,75,>99,2.51,75,>99
23,4.6,2.62,76,>99,2.76,78,>99,2.76,77,>99
24,4.8,2.89,79,>99,>3.00,>78,>99,>3.00,>80,>99
25,5.0,3.16,>80,>99,>3.00,>80,>99,>3.00,>80,>99
1 RW RW_n z_hauptschule T_hauptschule PR_hauptschule z_mittlere_reife T_mittlere_reife PR_mittlere_reife z_abitur T_abitur PR_abitur
2 5 1.0 -2.28 27 1 -2.02 30 3 -1.76 32 2
3 6 1.2 -2.01 30 2 -1.75 32 8 -1.51 35 6
4 7 1.4 -1.74 33 6 -1.49 35 11 -1.26 37 15
5 8 1.6 -1.46 35 11 -1.22 38 16 -1.01 40 21
6 9 1.8 -1.19 38 17 -.96 40 23 -.76 42 31
7 10 2.0 -.92 41 23 -.69 43 27 -.51 45 41
8 11 2.2 -.65 43 31 -.43 46 37 -.25 48 50
9 12 2.4 -.37 46 40 -.16 48 47 .00 50 57
10 13 2.6 -.10 49 52 .10 50 59 .25 53 65
11 14 2.8 .17 52 62 .37 54 69 .50 55 74
12 15 3.0 .44 54 72 .64 56 78 .75 58 79
13 16 3.2 .72 57 82 .90 59 84 1.00 60 88
14 17 3.4 .99 60 88 1.17 62 91 1.25 63 91
15 18 3.6 1.26 63 92 1.43 64 96 1.50 65 94
16 19 3.8 1.53 65 95 1.70 67 98 1.76 68 96
17 20 4.0 1.81 68 97 1.96 70 99 2.01 70 98
18 21 4.2 2.09 71 99 2.23 72 >99 2.26 73 99
19 22 4.4 2.35 74 >99 2.49 75 >99 2.51 75 >99
20 23 4.6 2.62 76 >99 2.76 78 >99 2.76 77 >99
21 24 4.8 2.89 79 >99 >3.00 >78 >99 >3.00 >80 >99
22 25 5.0 3.16 >80 >99 >3.00 >80 >99 >3.00 >80 >99

View file

@ -0,0 +1,26 @@
RW,RW_n,z_hauptschule,T_hauptschule,PR_hauptschule,z_mittlere_reife,T_mittlere_reife,PR_mittlere_reife,z_abitur,T_abitur,PR_abitur
6,1.00,<-3.00,<20,1,-2.88,21,1,-2.44,26,3
7,1.17,-2.95,20,1,-2.60,24,2,-2.17,28,3
8,1.33,-2.67,23,1,-2.33,27,2,-1.91,31,4
9,1.50,-2.39,26,2,-2.05,30,3,-1.64,34,7
10,1.67,-2.11,29,3,-1.77,32,5,-1.38,36,11
11,1.83,-1.83,32,5,-1.49,35,8,-1.11,39,19
12,2.00,-1.56,34,8,-1.21,38,14,-.84,42,24
13,2.17,-1.28,37,12,-.93,41,21,-.58,44,34
14,2.33,-1.00,40,18,-.65,44,29,-.31,47,43
15,2.50,-.72,43,26,-.37,46,40,.05,51,55
16,2.67,-.44,46,37,-.09,49,54,.22,52,62
17,2.83,-.16,48,49,.19,52,64,.49,55,72
18,3.00,.11,51,61,.46,55,76,.75,58,79
19,3.17,.39,54,75,.74,57,84,1.02,60,86
20,3.33,.67,57,82,1.02,60,88,1.29,63,95
21,3.50,.95,60,86,1.30,63,93,1.55,66,97
22,3.67,1.23,62,91,1.58,66,96,1.82,68,99
23,3.83,1.51,65,95,1.86,69,97,2.09,71,>99
24,4.00,1.79,68,97,2.14,71,99,2.35,74,>99
25,4.17,2.06,71,99,2.42,74,>99,2.62,76,>99
26,4.33,2.34,73,>99,2.56,76,>99,2.89,79,>99
27,4.50,2.62,76,>99,2.84,78,>99,>3.00,>80,>99
28,4.67,2.90,79,>99,>3.00,>80,>99,>3.00,>80,>99
29,4.83,>3.00,>80,>99,>3.00,>80,>99,>3.00,>80,>99
30,5.00,>3.00,>80,>99,>3.00,>80,>99,>3.00,>80,>99
1 RW RW_n z_hauptschule T_hauptschule PR_hauptschule z_mittlere_reife T_mittlere_reife PR_mittlere_reife z_abitur T_abitur PR_abitur
2 6 1.00 <-3.00 <20 1 -2.88 21 1 -2.44 26 3
3 7 1.17 -2.95 20 1 -2.60 24 2 -2.17 28 3
4 8 1.33 -2.67 23 1 -2.33 27 2 -1.91 31 4
5 9 1.50 -2.39 26 2 -2.05 30 3 -1.64 34 7
6 10 1.67 -2.11 29 3 -1.77 32 5 -1.38 36 11
7 11 1.83 -1.83 32 5 -1.49 35 8 -1.11 39 19
8 12 2.00 -1.56 34 8 -1.21 38 14 -.84 42 24
9 13 2.17 -1.28 37 12 -.93 41 21 -.58 44 34
10 14 2.33 -1.00 40 18 -.65 44 29 -.31 47 43
11 15 2.50 -.72 43 26 -.37 46 40 .05 51 55
12 16 2.67 -.44 46 37 -.09 49 54 .22 52 62
13 17 2.83 -.16 48 49 .19 52 64 .49 55 72
14 18 3.00 .11 51 61 .46 55 76 .75 58 79
15 19 3.17 .39 54 75 .74 57 84 1.02 60 86
16 20 3.33 .67 57 82 1.02 60 88 1.29 63 95
17 21 3.50 .95 60 86 1.30 63 93 1.55 66 97
18 22 3.67 1.23 62 91 1.58 66 96 1.82 68 99
19 23 3.83 1.51 65 95 1.86 69 97 2.09 71 >99
20 24 4.00 1.79 68 97 2.14 71 99 2.35 74 >99
21 25 4.17 2.06 71 99 2.42 74 >99 2.62 76 >99
22 26 4.33 2.34 73 >99 2.56 76 >99 2.89 79 >99
23 27 4.50 2.62 76 >99 2.84 78 >99 >3.00 >80 >99
24 28 4.67 2.90 79 >99 >3.00 >80 >99 >3.00 >80 >99
25 29 4.83 >3.00 >80 >99 >3.00 >80 >99 >3.00 >80 >99
26 30 5.00 >3.00 >80 >99 >3.00 >80 >99 >3.00 >80 >99

View file

@ -0,0 +1,58 @@
RW,RW_n,z_hauptschule,T_hauptschule,PR_hauptschule,z_mittlere_reife,T_mittlere_reife,PR_mittlere_reife,z_abitur,T_abitur,PR_abitur
18,1.00,<-3.00,<20,1,-2.49,25,1,-2.26,27,1
19,1.06,<-3.00,<20,1,-2.39,26,1,-2.16,28,2
20,1.11,-2.92,21,1,-2.29,27,2,-2.06,29,2
21,1.17,-2.81,22,1,-2.18,28,2,-1.96,30,2
22,1.22,-2.70,23,1,-2.08,29,2,-1.86,31,3
23,1.28,-2.59,24,1,-1.97,30,3,-1.76,32,3
24,1.33,-2.48,25,2,-1.87,31,3,-1.66,33,4
25,1.39,-2.37,26,2,-1.77,32,4,-1.57,34,5
26,1.44,-2.26,27,2,-1.67,33,5,-1.47,35,8
27,1.50,-2.14,29,2,-1.57,34,7,-1.37,36,9
28,1.56,-2.03,30,2,-1.46,35,8,-1.27,37,12
29,1.61,-1.92,31,3,-1.36,36,11,-1.17,38,13
30,1.67,-1.80,32,4,-1.26,37,13,-1.07,39,13
31,1.72,-1.69,33,5,-1.16,38,16,-.97,40,18
32,1.78,-1.58,34,7,-1.05,40,18,-.87,41,27
33,1.83,-1.47,35,8,-.95,41,21,-.77,42,32
34,1.89,-1.36,36,11,-.85,42,26,-.67,43,33
35,1.94,-1.24,38,13,-.74,43,28,-.57,44,37
36,2.00,-1.13,39,16,-.64,44,31,-.47,45,38
37,2.06,-1.02,40,19,-.54,45,33,-.37,46,39
38,2.11,-.91,41,22,-.44,46,35,-.28,47,44
39,2.17,-.79,42,25,-.33,47,41,-.18,48,49
40,2.22,-.68,43,29,-.23,48,45,-.08,49,55
41,2.28,-.57,44,32,-.13,49,49,.02,50,56
42,2.33,-.46,45,36,-.03,50,52,.12,51,59
43,2.39,-.35,47,39,.08,51,57,.22,52,62
44,2.44,-.23,48,42,.18,52,61,.32,53,64
45,2.50,-.12,49,44,.28,53,62,.42,54,69
46,2.56,-.01,50,50,.39,54,66,.52,55,70
47,2.61,.10,51,54,.49,55,68,.62,56,72
48,2.67,.21,52,57,.59,56,69,.72,57,74
49,2.72,.33,53,61,.69,57,72,.82,58,77
50,2.78,.44,54,65,.80,58,75,.92,59,78
51,2.83,.55,56,70,.90,59,78,1.01,60,81
52,2.89,.66,57,74,1.00,60,81,1.11,61,83
53,2.94,.77,58,77,1.10,61,85,1.21,62,88
54,3.00,.89,59,83,1.21,62,89,1.31,63,91
55,3.06,1.00,60,86,1.31,63,91,1.41,64,93
56,3.11,1.11,61,89,1.41,64,93,1.51,65,95
57,3.17,1.22,62,92,1.51,65,96,1.61,66,96
58,3.22,1.34,63,94,1.62,66,97,1.71,67,97
59,3.28,1.45,65,97,1.72,67,98,1.81,68,98
60,3.33,1.56,66,98,1.82,68,99,1.91,69,99
61,3.39,1.67,67,99,1.92,69,>99,2.01,70,>99
62,3.44,1.78,68,>99,2.03,70,>99,2.11,71,>99
63,3.50,1.90,69,>99,2.13,71,>99,2.21,72,>99
64,3.56,2.01,70,>99,2.23,72,>99,2.30,73,>99
65,3.61,2.12,71,>99,2.33,73,>99,2.40,74,>99
66,3.67,2.23,72,>99,2.44,74,>99,2.50,75,>99
67,3.72,2.34,73,>99,2.54,75,>99,2.60,76,>99
68,3.78,2.46,75,>99,2.64,76,>99,2.70,77,>99
69,3.83,2.57,76,>99,2.74,77,>99,2.80,78,>99
70,3.89,2.68,77,>99,2.85,79,>99,2.90,79,>99
71,3.94,2.79,78,>99,2.95,80,>99,>3.00,>80,>99
72,4.00,2.91,79,>99,>3.00,>80,>99,>3.00,>80,>99
73,4.06,>3.00,>80,>99,>3.00,>80,>99,>3.00,>80,>99
>74,4.11,>3.00,>80,>99,>3.00,>80,>99,>3.00,>80,>99
1 RW RW_n z_hauptschule T_hauptschule PR_hauptschule z_mittlere_reife T_mittlere_reife PR_mittlere_reife z_abitur T_abitur PR_abitur
2 18 1.00 <-3.00 <20 1 -2.49 25 1 -2.26 27 1
3 19 1.06 <-3.00 <20 1 -2.39 26 1 -2.16 28 2
4 20 1.11 -2.92 21 1 -2.29 27 2 -2.06 29 2
5 21 1.17 -2.81 22 1 -2.18 28 2 -1.96 30 2
6 22 1.22 -2.70 23 1 -2.08 29 2 -1.86 31 3
7 23 1.28 -2.59 24 1 -1.97 30 3 -1.76 32 3
8 24 1.33 -2.48 25 2 -1.87 31 3 -1.66 33 4
9 25 1.39 -2.37 26 2 -1.77 32 4 -1.57 34 5
10 26 1.44 -2.26 27 2 -1.67 33 5 -1.47 35 8
11 27 1.50 -2.14 29 2 -1.57 34 7 -1.37 36 9
12 28 1.56 -2.03 30 2 -1.46 35 8 -1.27 37 12
13 29 1.61 -1.92 31 3 -1.36 36 11 -1.17 38 13
14 30 1.67 -1.80 32 4 -1.26 37 13 -1.07 39 13
15 31 1.72 -1.69 33 5 -1.16 38 16 -.97 40 18
16 32 1.78 -1.58 34 7 -1.05 40 18 -.87 41 27
17 33 1.83 -1.47 35 8 -.95 41 21 -.77 42 32
18 34 1.89 -1.36 36 11 -.85 42 26 -.67 43 33
19 35 1.94 -1.24 38 13 -.74 43 28 -.57 44 37
20 36 2.00 -1.13 39 16 -.64 44 31 -.47 45 38
21 37 2.06 -1.02 40 19 -.54 45 33 -.37 46 39
22 38 2.11 -.91 41 22 -.44 46 35 -.28 47 44
23 39 2.17 -.79 42 25 -.33 47 41 -.18 48 49
24 40 2.22 -.68 43 29 -.23 48 45 -.08 49 55
25 41 2.28 -.57 44 32 -.13 49 49 .02 50 56
26 42 2.33 -.46 45 36 -.03 50 52 .12 51 59
27 43 2.39 -.35 47 39 .08 51 57 .22 52 62
28 44 2.44 -.23 48 42 .18 52 61 .32 53 64
29 45 2.50 -.12 49 44 .28 53 62 .42 54 69
30 46 2.56 -.01 50 50 .39 54 66 .52 55 70
31 47 2.61 .10 51 54 .49 55 68 .62 56 72
32 48 2.67 .21 52 57 .59 56 69 .72 57 74
33 49 2.72 .33 53 61 .69 57 72 .82 58 77
34 50 2.78 .44 54 65 .80 58 75 .92 59 78
35 51 2.83 .55 56 70 .90 59 78 1.01 60 81
36 52 2.89 .66 57 74 1.00 60 81 1.11 61 83
37 53 2.94 .77 58 77 1.10 61 85 1.21 62 88
38 54 3.00 .89 59 83 1.21 62 89 1.31 63 91
39 55 3.06 1.00 60 86 1.31 63 91 1.41 64 93
40 56 3.11 1.11 61 89 1.41 64 93 1.51 65 95
41 57 3.17 1.22 62 92 1.51 65 96 1.61 66 96
42 58 3.22 1.34 63 94 1.62 66 97 1.71 67 97
43 59 3.28 1.45 65 97 1.72 67 98 1.81 68 98
44 60 3.33 1.56 66 98 1.82 68 99 1.91 69 99
45 61 3.39 1.67 67 99 1.92 69 >99 2.01 70 >99
46 62 3.44 1.78 68 >99 2.03 70 >99 2.11 71 >99
47 63 3.50 1.90 69 >99 2.13 71 >99 2.21 72 >99
48 64 3.56 2.01 70 >99 2.23 72 >99 2.30 73 >99
49 65 3.61 2.12 71 >99 2.33 73 >99 2.40 74 >99
50 66 3.67 2.23 72 >99 2.44 74 >99 2.50 75 >99
51 67 3.72 2.34 73 >99 2.54 75 >99 2.60 76 >99
52 68 3.78 2.46 75 >99 2.64 76 >99 2.70 77 >99
53 69 3.83 2.57 76 >99 2.74 77 >99 2.80 78 >99
54 70 3.89 2.68 77 >99 2.85 79 >99 2.90 79 >99
55 71 3.94 2.79 78 >99 2.95 80 >99 >3.00 >80 >99
56 72 4.00 2.91 79 >99 >3.00 >80 >99 >3.00 >80 >99
57 73 4.06 >3.00 >80 >99 >3.00 >80 >99 >3.00 >80 >99
58 >74 4.11 >3.00 >80 >99 >3.00 >80 >99 >3.00 >80 >99

2879
TAS26/renv.lock Normal file

File diff suppressed because it is too large Load diff

14
TAS26/setup_renv.R Normal file
View file

@ -0,0 +1,14 @@
# Einmalig ausfuehren, bevor die App zum ersten Mal gestartet wird.
# Initialisiert renv und installiert alle benoetigten Pakete.
#
# DBI und RSQLite werden vom gesourcten Pseudonym-Skript benoetigt,
# nicht direkt von der App selbst.
renv::init()
pkgs = c("shiny", "dplyr", "ggplot2", "haven", "officer", "DBI", "RSQLite", "formr")
install.packages(pkgs)
renv::snapshot()
message("Setup abgeschlossen. App starten mit: shiny::runApp()")