Skip to content

Instantly share code, notes, and snippets.

View nrkoehler's full-sized avatar
👁️‍🗨️
Focusing

Norbert Köhler nrkoehler

👁️‍🗨️
Focusing
View GitHub Profile
@moodymudskipper
moodymudskipper / gist:5f227be37c5d9a6b66fe8fa6a2608d32
Last active April 2, 2023 14:25
Custom roxygen2 tags : "tip" example
# You'll also need to add roxygen2 to Suggests in the DESCRIPTION file to satisfy checks
# or just call `usethis::use_package("roxygen2", "Suggests")`
# first we define the tag used in examples in the doc ----------------------------------------------
#' @export
#' @importFrom roxygen2 roxy_tag_parse
roxy_tag_parse.roxy_tag_tip <- function(x) {
roxygen2::tag_markdown(x)
}
@datagistips
datagistips / banomap.R
Created January 7, 2023 17:23
A simple Shiny App to Geocode Addresses and See them on a Map
library(shiny)
library(banR) # Pour le géococage et l'appel à l'API BANO
library(leaflet) # Pour la carte interactive
# ui est la partie affichage
ui <- fluidPage(
fluidRow(column(12,
h1("Géocodage d'adresse BANO"),
textInput("adresse", label = NULL, "", placeholder = "Tapez une adresse"),

Arbeitsamt Jobsuche API

Die Bundesagentur für Arbeit verfügt über die größte Datenbank für offene Stellen in Deutschland. Obwohl sie vollständig staatlich ist und es sich dabei um einen sehr spannenden Basisdatensatz handelt, mit dem viele Analysen möglich wären, bietet die Bundesagentur für Arbeit dafür bis heute keine offizielle API an.

Authentifizierung

Die Authentifizierung funktioniert per OAuth 2 Client Credentials mit JWTs. Die Client Credentials sind z.B. in der App hinterlegt:

ClientID: c003a37f-024f-462a-b36d-b001be4cd24a

@LilithWittmann
LilithWittmann / autobahn.md
Last active October 26, 2023 12:11
autobahn.md
library(tidyverse)
library(broom)
library(latex2exp)
library(patchwork)
set.seed(1234)

logit_df <- tibble(x = seq(-5, 5, length.out = 100)) %>% 
    mutate(p = 1/(1 + exp(-x))) %>% 
    mutate(y = rbinom(n(), size = 1, prob = p))
library(tidyverse)
library(gt)
tuesdata <- tidytuesdayR::tt_load(2020, "36")
country_sel <- c("China", "India", "United States", "Indonesia", "Mexico", "Pakistan")
yield_data <- tuesdata$key_crop_yields %>%
janitor::clean_names() %>%
rename_with(~ str_remove(., "_tonnes_per_hectare")) %>%
select(entity:beans, -code) %>%
@jlacko
jlacko / rstudio-init-script.R
Last active July 7, 2021 21:35
Init script for new RStudio installation, promoting best practices
# make certain jsonlite is available
if(!require(jsonlite, quietly = TRUE)) {
install.packages("jsonlite")
library(jsonlite)
}
# get the path to settings file
path <- if (Sys.info()[["sysname"]] == "Windows") {
paste0(Sys.getenv('APPDATA'), "\\RStudio\\rstudio-prefs.json")
} else {
@jthomasmock
jthomasmock / many_models.R
Created April 26, 2020 16:43
Take many variables, fit a model to them all at once, and visualize them all at once
library(tidyverse)
library(espnscrapeR)
library(broom)
library(glue)
# Get data from espnscrapeR
all_off <- 2000:2019 %>%
map_dfr(scrape_team_stats_nfl)
# Many LMs ----------------------------------------------------------------
library(isoband)
library(magick)
library(sf)
library(tidyverse)
# Adapted from Claus Wilke's code
# https://github.com/clauswilke/isoband
sf_from_image <- function(image, nbands) {
image_gray <- image %>% image_quantize(colorspace = "gray")
image_raster <- as.raster(image_gray)
@EmilHvitfeldt
EmilHvitfeldt / horizontal.R
Created February 25, 2018 06:35
Horizontal annotations with ggrepel and ggplot2
library(tidyverse)
library(ggrepel)
set.seed(1234)
data <- tibble(x = seq_len(100),
y = cumsum(rnorm(100)))
anno_data <- data %>%
filter(x %% 25 == 10) %>%