This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(data.table) | |
library(brms) | |
library(cmdstanr) | |
set_cmdstan_path('//wsl$/Ubuntu/home/andche/.cmdstan/cmdstan-2.35.0') | |
distr_fun_std <- function(x, mean, sigma, lambda){ | |
lambda+(1-2*lambda)*pnorm((x- mean)/sigma) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from apscheduler.schedulers.blocking import BlockingScheduler | |
from datetime import datetime | |
import json | |
import pickle | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(data.table) | |
library(xml2) | |
library(stm) | |
library(quanteda) | |
library(gofastr) | |
library(stopwords) | |
library(spacyr) | |
library(quanteda) | |
library(quanteda.textplots) | |
library(Hmisc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(BayesFactor) | |
library(future.apply) | |
library(future.batchtools) | |
# for the simulations, I used our cluster that runs PBS Torque | |
plan(batchtools_torque, resources = list(walltime = '01:00:00', memory = '2Gb')) # specify that the PBS Torque cluster is used and the resources we want | |
# create conditions combinations | |
conditions <- expand.grid(d = seq(0, 0.36, 0.04), N = seq(5, 65, 4)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#PBS -N <%= job.name %> | |
#PBS -o <%= log.file %> | |
#PBS -l walltime=<%= resources$walltime %>,mem=<%= resources$memory %>M | |
#PBS -q batch | |
#PBS -j oe | |
## setup modules | |
## create our own temp dir (and clean it up later) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(datasauRus) | |
library(data.table) | |
library(ragg) | |
library(ggplot2) | |
dsd <- datasaurus_dozen | |
setDT(dsd) | |
dsd <- dsd[dataset%in%c('star','dino','away', 'circle')] | |
dsd[,z:=rnorm(.N, sd = 0.4)] | |
dsd[,y_new:=0.2*x+z+y, by = dataset] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seq_presentation <- function(p, name = 'plot_layers_%i.png', res = 320, width = 6.2, height = 6.2){ | |
n_layers <- length(p$layers) | |
y_range <- ggplot_build(p)$layout$panel_scales_y[[1]]$range$range | |
for (i in c(n_layers:0)){ | |
if (!is.null(name)) | |
png(file = sprintf(name , i), res = res, width = width*res, height = height*res) | |
if (i!=0) { | |
p_copy <- copy(p) | |
p_copy$layers[n_layers:i] <- NULL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(gganimate) | |
library(ggthemes) | |
library(data.table) | |
n = 80 # number of dots | |
max_r = 300 # aperture radius | |
dt <- data.table(r = max_r*sqrt(runif(n)), theta =2*pi*runif(n), dot_n = 1:n) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# turboscale values are from https://gist.github.com/mikhailov-work/ee72ba4191942acecc03fe6da94fc73f | |
library(grDevices) | |
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), | |
c(0.20860,0.11802,0.34607), | |
c(0.21291,0.12947,0.37314), | |
c(0.21708,0.14087,0.39964), |