Skip to content

Instantly share code, notes, and snippets.

We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
region_iso sex age ex_diff_mean_2020 ex_diff_mean_2021 ex_diff_q0.025_2020 ex_diff_q0.025_2021 ex_diff_q0.975_2020 ex_diff_q0.975_2021 bbi_q0.5_2020 bbi_q0.5_2021 bbi_q0.025_2020 bbi_q0.025_2021 bbi_q0.975_2020 bbi_q0.975_2021 region_position region_code_iso3166_2_alpha3 region_code_iso3166_1 region_code_iso3166_1_alpha3 region_code_stmf calendar_stmf region_code_hmd region_code_wpp region_code_coverage region_name region_name_short region_level country_name hemisphere continent year death_total_nweeksmiss as_of e0avgdiff1619_q0.5 e0avgdiff1619_q0.025 e0avgdiff1619_q0.975
AT T 0 -0.75726295307785 0.109872939746115 -0.867486087753811 -0.00873775031377946 -0.640273398677998 0.228466890627553 -4.19661664163826 0.14435079615867 -11.6911032794272 -0.0129431229215541 -2.74793040709203 0.287786153797217 14 AUT AT AUT AUT iso_week_date AUT 40 Austria Austria AUT 0 Austria n Europe 2021 0 52 0.169764067500815 0.141474494918143 0.204577126571475
BE T 0 -1.18765648644931 1.13996997057471 -1.29402467005087 1.034239584327
@jschoeley
jschoeley / gist:45a0e05b54512744e85d3eb00eeeae43
Created December 12, 2020 21:08
Disaggregating counts from Lexis surface with irregular grouping via PCLMM
# Disaggregation of 2D histogram of Poisson-counts with irregular bins
# based upon the penalized composite link mixed model
#
# Jonas Schöley, based on code from
# Deirdre I.R. Douma: The Penalized Composite Link Mixed Model.
# see further references in code
# Given is a matrix of observed counts over 2 dimensions (here
# year and age, i.e. a so-called Lexis surface).
# Each entry in the matrix corresponds to a rectangular region on the
@jschoeley
jschoeley / 2018-07-03-bubble-grid-vs-choropleth.R
Last active May 27, 2022 14:18
Bubble-grid versus choropleth map
# Comparing bubble-grid with choropleth map
# Jonas Schöley
# Init --------------------------------------------------------------------
library(eurostat) # eurostat data
library(rnaturalearth) # worldwide map data
library(tidyverse) # tidy data transformation
library(lubridate) # date and time support
library(sf) # simple features GIS
@jschoeley
jschoeley / bubble-grid-maps.R
Created July 1, 2018 14:35
Bubble-grid-maps in R
# BUBBLE-GRID-MAPS
# Jonas Schöley (cc-by)
library(eurostat) # eurostat data
library(tidyverse) # tidy data transformation
library(lubridate) # date and time support
library(sf) # simple features GIS
# download eurostat data of population counts by NUTS-3 region
euro_pop <-
@jschoeley
jschoeley / different_legend_styles.R
Created January 15, 2018 10:47
Tricolore: Experimenting with different legend styles for centered ternary color scales
#' ---
#' title: Different legend styles for centered ternary color scales
#' author: Jonas Schöley, Ilya Kashnitsky
#' output:
#' pdf_document
#' ---
#+echo=FALSE
knitr::opts_chunk$set(warning=FALSE, message=FALSE,
fig.width = 15, fig.height = 15)