Skip to content

Instantly share code, notes, and snippets.

View nevrome's full-sized avatar
🛠️

Clemens Schmid nevrome

🛠️
View GitHub Profile
# get some large EIGENSTRAT format data from
# https://edmond.mpdl.mpg.de/imeji/collection/OBNPDy16CfZWPhz0?q=
ind_file <- tempfile()
geno_file <- tempfile()
download.file(
"https://edmond.mpdl.mpg.de/imeji/file/d7/32/34/70-96ac-4a64-8eb2-c7d6db355d4a/0/original/77fa944dc4369018c6478dcec3f6ced6.txt?filename=Wang2019Caucasus.ind.txt",
destfile = ind_file
)
download.file(
"https://edmond.mpdl.mpg.de/imeji/file/ea/ea/02/b4-4124-43f4-a458-3cf728f8e7bc/0/original/2f35c3d890e8456ac634d18ee45e6c27.txt?filename=Wang2019Caucasus.geno.txt",
@nevrome
nevrome / data.txt
Last active October 31, 2022 13:25
Minimal Haskell parsec example
Sample1 [1100±30]
Sa2 [3200±50]
Sa3 [1400±20]
Sa4 [2000±30]
Sa6 [133413±70]
Sa7 [1300±30]
Sample9 [1300±50]
S8 [1600±30]
@nevrome
nevrome / experiment.R
Last active May 6, 2021 12:58
An experiment with the lambda.r R package (Haskell and R code)
library(lambda.r)
FruitSet("LAS") %as% "LAS"
FruitSet("SAS") %as% "SAS"
FruitSet("OFS") %as% "OFS"
FruitSetList(...) %::% FruitSet... : FruitSetList
FruitSetList(...) %as% asFruitSetList(list(...))
asFruitSetList(xs) %::% list : FruitSetList
@nevrome
nevrome / world_map_ascii.R
Last active August 8, 2022 13:45
R script to plot an ASCII world map with highlighted positions
# . . ... ........... . ...
#. ................. . .. ..... ...... ..... .......................
# . .......... ... ... .......................... .
# ............. . ...............................
# ............ .. X .. X.... .................
# ....... ..... .. ...................
# .. . ............ .... ..........
# . ............. . .. .
# ..... .......... .. .
# .......... ...... . ..
@nevrome
nevrome / elevatr_rayshader_ggplot2.R
Last active January 17, 2021 08:00
R script to get a digital elevation model with sf and elevatr, create a hillshaded raster with rayshader and plot it with ggplot2 and ggspatial
library(magrittr)
library(ggplot2)
library(rayshader)
#### get some point data of c14 dates from Switzerland (with c14bazAAR) ####
c14dates <- c14bazAAR::get_RADON() %>%
dplyr::filter(
country == "Switzerland",
culture == "Cortaillod"
) %>%
@nevrome
nevrome / wiki_login_create.R
Created May 18, 2017 19:23
drafts of wikimedia API R functions
library(httr)
library(magrittr)
library(tidyverse)
clientlogin <- function(user, pw) {
# get login token
token <- httr::modify_url(
"http://127.0.0.1:8080/w/api.php",
query = list(
action = "login",