diff --git a/columns.tex b/columns.tex new file mode 100644 index 0000000..5f68102 --- /dev/null +++ b/columns.tex @@ -0,0 +1,38 @@ +% From: https://support.rstudio.com/hc/en-us/community/posts/202717656-Can-we-have-columns-in-rmarkdown-beamer-presentations- +% +% In the YAML header of your Rmd file, add a reference to a tex file to add to the tex file preamble ; +% +% output: +% beamer_presentation: +% includes: +% in_header: mypreamble.tex +% +% In mypreamble.tex, add: +% +% \def\begincols{\begin{columns}} +% \def\begincol{\begin{column}} +% \def\endcol{\end{column}} +% \def\endcols{\end{columns}} +% +% Finally, in the Rmd file, use this kind of syntax: +% +% ## Two Column Layout +% +% \begincols +% \begincol{.48\textwidth} +% +% This slide has two columns. +% +% \endcol +% \begincol{.48\textwidth} +% +% ```{r pressure} +% plot(pressure) +% ``` +% +% \endcol +% \endcols +\def\begincols{\begin{columns}} +\def\begincol{\begin{column}} +\def\endcol{\end{column}} +\def\endcols{\end{columns}} diff --git a/vhk.Rmd b/vhk.Rmd index 20917d0..bb3f51e 100644 --- a/vhk.Rmd +++ b/vhk.Rmd @@ -1,14 +1,15 @@ --- title: "Vorhofkatheter-Statistik" author: "Daniel Kraus" -date: '2018-12-30' +date: '2018-12-29' output: ioslides_presentation: default + slidy_presentation: default beamer_presentation: default --- ```{r setup, include=FALSE} -knitr::opts_chunk$set(echo = FALSE) +knitr::opts_chunk$set(echo = FALSE, warning = FALSE) library(tidyverse) raw_data = read_csv('vhk.csv') %>% @@ -28,7 +29,7 @@ cath_by_year %>% geom_col() + scale_y_continuous(breaks = seq(from = 0, to = max_y_break, by = 10)) + scale_x_continuous(breaks = seq(from = first_year, to = last_year, by = 1)) + - labs(x = NULL, y = NULL) + labs(x = NULL, y = "Anzahl Katheter") ``` ## Alter der Patienten @@ -39,7 +40,7 @@ raw_data %>% coord_cartesian(ylim = c(20, 100)) + scale_x_continuous(breaks = seq(from = first_year, to = last_year, by = 1)) + scale_y_continuous(breaks = seq(from = 20, to = 100, by = 10)) + - labs(x = NULL, y = NULL) + labs(x = NULL, y = "Jahre") ``` ## Geschlecht der Patienten @@ -52,13 +53,53 @@ raw_data %>% group_by(Year) %>% summarise(PercentFemale = sum(Sex == "weiblich") labs(x = NULL, y = "Anteil Frauen") ``` +## Katheterlokalisation +Ist da ein Trend hin zu immer mehr Kathetern von links?! +```{r insertion_site} +raw_data %>% mutate(Side = factor(Side, levels = c("rechts", "links"))) %>% + ggplot(aes(x = Year)) + + facet_grid(InsertionSite ~ Side) + + geom_bar() + + labs(x = NULL, y = "Anzahl Katheter") +``` + +## Anteil der Arztrollen +Um 2014 herum haben einige die Facharztprüfung abgelegt, ist das der Grund für die Auffälligkeit 2015/2016? +```{r percent_residents} +raw_data %>% group_by(Year) %>% + summarize(Assistenzarzt = sum(SurgeonRole == "Assistenzarzt") / n(), + Facharzt = sum(SurgeonRole == "Facharzt") / n(), + Oberarzt = sum(SurgeonRole == "Oberarzt") / n()) %>% + gather(key = Role, value = Percent, Assistenzarzt, Facharzt, Oberarzt) %>% + ggplot(aes(x = Year, y = Percent)) + + scale_x_continuous(breaks = seq(from = first_year, to = last_year, by = 1)) + + scale_y_continuous(labels = scales::percent_format(accuracy = 1)) + + facet_grid(Role ~ .) + + geom_col() + + labs(x = NULL, y = "Anteil in den gelegten Kathetern") +``` + +## Hitparade der Durchleuchtungsdauern +```{r greatest_fluoroscopy} +raw_data %>% + group_by(Surgeon) %>% + summarize(FluoroscopyIndex = median(InsertionFluoroscopyDuration, na.rm = TRUE)) %>% + arrange(desc(FluoroscopyIndex)) %>% + top_n(-10, FluoroscopyIndex) %>% + mutate(Surgeon = factor(Surgeon, levels = Surgeon)) %>% + ggplot(aes(x = Surgeon, y = FluoroscopyIndex)) + + geom_col() + + coord_flip() + + labs(x = NULL, y = "Median der Durchleuchtungsdauer [s]") +``` + ## Hitparade der Implanteure ```{r greatest_surgeons} raw_data %>% count(Surgeon) %>% arrange(n) %>% top_n(10, n) %>% mutate(Surgeon = factor(Surgeon, levels = Surgeon)) %>% ggplot(aes(x = Surgeon, y = n)) + geom_col() + coord_flip() + - labs(x = NULL, y = NULL) + labs(x = NULL, y = "Gesamtzahl Katheter") ``` ## Hitparade der Assistenten @@ -67,6 +108,6 @@ raw_data %>% count(Assistant) %>% arrange(n) %>% top_n(10, n) %>% mutate(Assista ggplot(aes(x = Assistant, y = n)) + geom_col() + coord_flip() + - labs(x = NULL, y = NULL) + labs(x = NULL, y = "Gesamtzahl Katheter") ```