Skip to content

Instantly share code, notes, and snippets.

View z3tt's full-sized avatar
👨‍💻
Coding at home

Cédric Scherer z3tt

👨‍💻
Coding at home
View GitHub Profile
# License: Apache 2.0
# A straightforward translation of the Python code:
turbo_colormap_data <- matrix(
c(
c(0.18995, 0.07176, 0.23217),
c(0.19483, 0.08339, 0.26149),
c(0.19956, 0.09498, 0.29024),
c(0.20415, 0.10652, 0.31844),
@mschnetzer
mschnetzer / gerwealth.R
Last active April 9, 2020 12:21
Wenn Deutschland so verteilt wäre wie Vermögen (https://twitter.com/matschnetzer/status/1178930993186693121)
library(tidyverse)
library(msthemes)
library(sf)
# GeoJSON: http://opendatalab.de/projects/geojson-utilities/
geodat <- st_read("landkreise_simplify200.geojson", quiet=TRUE, stringsAsFactors=FALSE) %>%
mutate(
center = map(geometry, st_centroid),
centercoord = map(center, st_coordinates),
@pr130
pr130 / clean_dkb_data.Rmd
Created October 10, 2020 13:37
Clean csvs exported from DKB online banking
---
title: "DKB Export Cleanup"
author: "Frie"
date: "10/10/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(purrr)
library(tidyverse)
library(ggsankey)
## data via https://ourworldindata.org/grapher/total-agricultural-area-over-the-long-term
hablar::set_wd_to_script_path()
df <-
read_csv("total-agricultural-area-over-the-long-term.csv") %>%
janitor::clean_names() %>%
@tylermorganwall
tylermorganwall / submarine_cable_map.R
Last active August 3, 2025 06:01
Submarine Cable Map Dataviz
library(geojsonsf)
library(sf)
library(rayrender)
#Data source: https://github.com/telegeography/www.submarinecablemap.com
cables = geojson_sf("cable-geo.json")
cablescene = list()
counter = 1
for(i in 1:length(cables$geometry)) {
@steveharoz
steveharoz / ggdist psychometric functions.R
Last active September 28, 2021 07:44
ggdist psychometric functions
library(tidyverse)
library(ggdist)
# make some data
expand_grid(
condition = c("A", "B"),
stimulus = seq(-3,3,0.3),
repetitions = 1:20
) %>%
# make some noisy response data