Skip to content

Instantly share code, notes, and snippets.

View isirf's full-sized avatar

Isabell Roitner-Fransecky isirf

View GitHub Profile
library(tidyverse)
library(eurostat)
library(countrycode)
library(gt)
library(gtExtras)
data <- get_eurostat("prc_hicp_manr", filters = list(coicop = "CP00"))
ea.avg <- data |> filter(geo == "EA") |> slice_max(time, n=1) |> pull(values)
@juliasilge
juliasilge / horror.md
Created November 3, 2022 20:41
#TidyTuesday horror movie 😱 descriptions
library(tidyverse)
library(tidytext)
library(ggraph)
library(igraph)
#> 
#> Attaching package: 'igraph'
#> The following objects are masked from 'package:dplyr':
#> 
#>     as_data_frame, groups, union
# converts slippy map XYZ tile to quadkey
# https://docs.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system
as_binary = function(x){
tmp = rev(as.integer(intToBits(x)))
id = seq_len(match(1, tmp, length(tmp)) - 1)
tmp[-id]
}
deg2num = function(lat_deg, lon_deg, zoom) {
@geneorama
geneorama / wardmap.R
Last active May 30, 2022 22:04
Plot Chicago ward map with labels that are actually in the wards
##==============================================================================
## INITIALIZE
##==============================================================================
rm(list=ls())
library(geneorama) ## Not actually needed
library(data.table)