Skip to content

Instantly share code, notes, and snippets.

library(tidyverse)
library(lubridate)
library(msthemes)
library(patchwork)
# Get Covid data by age here: https://www.data.gv.at/katalog/dataset/3765ed62-0f9d-49ad-83b0-1405ed833108
# And vaccination data here: https://www.ages.at/themen/krankheitserreger/coronavirus/
cov <- read_csv2("CovidFaelle_Altersgruppe.csv") %>%
mutate(Time = as.Date(Time, "%d.%m.%Y"))
# This code is adapted from original code by @cnicault https://github.com/cnicault/tidytuesday/tree/master/2021/2021-21-ask_a_manager
library(tidyverse)
library(readxl)
library(scales)
library(ggbump)
library(glue)
library(showtext)
library(msthemes)
library(tidyverse)
library(lubridate)
library(msthemes)
library(ragg)
library(showtext)
# get data from https://www.oenb.at/isaweb/report.do?lang=DE&report=7.17
unemp <- vroom::vroom("unemployment.csv")
font_add_google("Abel", "abel")
@mschnetzer
mschnetzer / covidmap.R
Created October 24, 2020 08:00
Entwicklung der Covid-Pandemie in Österreichs Bezirken (https://twitter.com/matschnetzer/status/1319904508386942976)
library(tidyverse)
library(sf)
library(gganimate)
library(transformr)
library(lubridate)
library(msthemes) # https://github.com/mschnetzer/msthemes
# Import online map
bezirke <- st_read("https://raw.githubusercontent.com/ginseng666/GeoJSON-TopoJSON-Austria/master/2017/simplified-99.9/bezirke_999_geo.json") %>%
mutate(iso = as.numeric(iso))
library(tidyverse)
library(survey)
library(msthemes)
library(gganimate)
library(Hmisc)
# Load HFCS and Non-core data
load("hfcs2017AT.rda")
load("non-core-at.rda")
library(tidyverse)
library(lubridate)
library(msthemes)
library(gganimate)
unemp <- read_csv("unemployment.csv")
df <- unemp %>% filter(period == "month", indicator == "Unemployment registered, total, M-end NSA") %>%
select(year,month,values) %>%
mutate(values = values*1000) %>%
@mschnetzer
mschnetzer / hospbeds.r
Created March 31, 2020 09:51
Zahl und Entwicklung der Spitalsbetten
library(tidyverse)
library(eurostat)
library(msthemes)
library(patchwork)
beds <- get_eurostat("hlth_rs_bds", filters = list(unit = "P_HTHAB", facility = "HBEDT", time = 2000:2017), time_format = "num")
abs <- beds %>% filter(geo %in% c("AT","DE","FR","ES","IT","SE","UK"), time == 2017) %>%
ggplot(aes(x = reorder(geo, values), y = values)) +
geom_bar(stat = "identity", aes(fill=geo)) +
@mschnetzer
mschnetzer / hfcs2017.r
Created March 30, 2020 12:37
Overview of the new HFCS 2017 data
library(tidyverse)
library(readxl)
library(countrycode)
library(msthemes)
library(patchwork)
ineq <- read_xlsx("HFCS - Statistical tables - wave 2017 - March 2020.xlsx",
sheet = "J4 Net wealth inequality ind", skip = 2) %>%
filter(...2 %in% c("Top 10% share", "Gini coefficient")) %>%
select(-c(...1,...3,...4,`euro\r\narea`), measure = ...2) %>%
library(tidyverse)
library(rvest)
library(msthemes)
library(gganimate)
library(magick)
library(sf)
library(viridis)
url <- "https://de.wikipedia.org/wiki/COVID-19-Pandemie_in_%C3%96sterreich"
@mschnetzer
mschnetzer / ecotax.r
Last active January 29, 2020 09:32
Öko-Steuern in Österreich 1995-2018 (https://twitter.com/matschnetzer/status/1222421619353612290)
library(tidyverse)
library(msthemes)
library(readxl)
library(patchwork)
library(eurostat)
# Download data from http://statistik.at/web_de/statistiken/wirtschaft/oeffentliche_finanzen_und_steuern/steuerstatistiken/oeko-steuern/index.html
data <- read_xlsx("oeko-steuern_1995_bis_2018.xlsx",skip = 1, n_max = 5) %>% filter(!is.na(`1995`))
taxdat <- data %>% gather(year, tax, 2:25) %>% mutate_at(vars(tax), ~./1000)