Skip to content

Instantly share code, notes, and snippets.

@taraskaduk
taraskaduk / theme_tk.R
Last active October 15, 2020 23:30
Personal ggplot theme
options(warn=-1)
library(tibble)
library(extrafont)
library(scales)
loadfonts()
theme_foundation <- function(base_size=12, base_family="") {
thm <- theme_grey(base_size = base_size, base_family = base_family)
for (i in names(thm)) {
if ("colour" %in% names(thm[[i]])) {
@taraskaduk
taraskaduk / get-admin-boundaries-osmdata.R
Created September 27, 2020 16:58
Get admin boundaries as sf objects using {osmdata} package
library(osmdata)
library(dplyr)
library(ggplot2)
#Define a place of interest
place <- "Kyiv Ukraine"
#First, get all admin boundaries associated with your request
all_boundaries <- opq(place) %>%
add_osm_feature(key = "boundary",