R/plot_verlauf_relative.R

Defines functions plot_verlauf_relative

Documented in plot_verlauf_relative

#' Zeige prozentuelle Zunahmen pro Bundesland seit 21.03.2020
#' 
#' Zeige prozentuelle Veränderungen seit der Datenaufnahme von coronaDAT
#' für jedes Bundesland.
#' @examples 
#' plot_verlauf_relative()
#' @export
plot_verlauf_relative <- function() {
  ts <- data_corona_ts()$ts_bundesland
  ts %>% 
    dplyr::group_by(bundesland) %>% 
    dplyr::arrange(date) %>% 
    dplyr::mutate(freq = freq/freq[1] - 1) %>% 
    ggplot(aes(date, freq, color = bundesland)) +
    geom_line() +
    theme_minimal() +
    scale_y_continuous(breaks = 1:15/10, labels = paste0(1:15*10, "%")) +
    ylab(paste("Zunahme seit", min(ts$date)))
}
statistikat/coronar documentation built on April 6, 2020, 6:25 p.m.