Skip to content

Instantly share code, notes, and snippets.

View ikashnitsky's full-sized avatar

Ilya Kashnitsky ikashnitsky

View GitHub Profile
@ikashnitsky
ikashnitsky / HMD_all_countries_sex_ratio.R
Last active October 12, 2016 19:03
Create a plot showing sex ratios at all ages for all countries from Human Mortality Database
################################################################################
#
# Sex ratios 11-10-2016
# Sex ratios VS age in all HMD countries
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com
#
################################################################################
# load required packages
require(dplyr) # version 0.5.0
################################################################################
#
# Sex ratios 12-10-2016
# Replicate the analysis for the post https://habrahabr.ru/post/311970/ (RUS)
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com
#
################################################################################
# load required packages
# The code is written and tested on a PC-win7-x64
###############################################################################
#
# Sex ratios 29-10-2016
# HMD data: illustrate Russian male mortality specifics
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com
#
################################################################################
# load required packages
library(dplyr) # version 0.5.0
################################################################################
#
# Sex ratios 11-11-2016
# Analysis - US counties.
# Check the effect of urb/rur of the link between homicide rate and adult sex
# ratio. Doubts raised by https://dx.doi.org/10.1007/s12110-016-9271-x
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com
#
################################################################################
@ikashnitsky
ikashnitsky / sweden_hmd_gender_gap_in_mortality.R
Created November 26, 2016 00:36
Explore gender gap in age-specific mortality rates in Sweden at various times: 1751, 1800, 1850, 1900, 1925, 1950, 1960, 1970, 1980, 1990, 2000, 2010
###############################################################################
#
# Sweden 26-11-2016
# HMD data: illustrate gender difference in mortality
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com
#
################################################################################
# The code is written and tested on a x86_64-pc-linux-gnu (64-bit) machine
# R version 3.3.2
@ikashnitsky
ikashnitsky / colorcoded-map-population-structures.R
Last active February 5, 2020 09:28
Code to reproduce the RGB map of the population structure of NUTS-3 regions of Europe -- https://ikashnitsky.github.io/2017/colorcoded-map/
################################################################################
#
# ikashnitsky.github.io 2017-06-30
# Produce an RGB coded map of pop structures at NUTS-3 level
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com
#
################################################################################
# load required packages
library(tidyverse) # data manipulation and viz
################################################################################
#
# ikashnitsky.github.io 2017-07-15
# The speed of ggplot2 using canvas
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com
#
################################################################################
# load required packages
library(tidyverse) # data manipulation and viz
@ikashnitsky
ikashnitsky / maps-with-ggplot2.R
Last active August 11, 2021 17:04
Lab script prepared for MPIDR IDEM 181 course on data visualization with R. More info on the course: https://goo.gl/xXQH55
################################################################################
#
# ikashnitsky.github.io 2017-06-22
# Creating maps with ggplot2
# Lab script prepared for MPIDR IDEM 181 course on data visualization with R
# More info on the course: https://goo.gl/xXQH55
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com
#
################################################################################
@ikashnitsky
ikashnitsky / microbenchmark-poly-vs-map.R
Last active January 24, 2018 05:14
Compare the speed of ggplot creation: geom_poly() VS geom_map()
################################################################################
#
# ikashnitsky.github.io 2017-07-17
# geom_map VS geom_polygon: the speed of maps creation
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com
#
################################################################################
# load required packages
library(tidyverse) # data manipulation and viz
@ikashnitsky
ikashnitsky / world-convergence-in-male-life-expectancy.R
Last active January 24, 2018 05:14
Global convergence in male life expectancy at birth since 1950
################################################################################
#
# ikashnitsky.github.io 2017-07-17
# Trying ggjoy.
# The world convergence in male life expectancy at birth since 1950
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com
#
################################################################################
library(tidyverse)