Skip to content

Instantly share code, notes, and snippets.

View wlandau's full-sized avatar

Will Landau wlandau

View GitHub Profile
@wlandau
wlandau / app.R
Last active April 10, 2024 20:23 — forked from jcheng5/app.R
crew + ExtendedTask while keeping track of who requested each result
library(shiny)
library(crew)
library(promises)
library(bslib)
run_task <- function(model, n, delay_secs) {
Sys.sleep(delay_secs)
model(n)
}
@wlandau
wlandau / .gitignore
Created June 26, 2019 14:03 — forked from hadley/.gitignore
Benchmark different ways of reading a file
.Rproj.user
.Rhistory
.RData
*.Rproj
*.html
@wlandau
wlandau / fixed_choice_design_sim.R
Created March 9, 2019 16:42 — forked from benlistyg/fixed_choice_design_sim.R
How does the degree distribution of a FCD network differ from the "true" network of interest?
# Fixed Choice Design Lunchtime Simulation
# 2019-02-06
library(igraph)
library(dplyr)
library(ggplot2)
#Experimental Conditions
conds <- expand.grid(
c(150),
@wlandau
wlandau / unlockEnvironment.r
Created December 15, 2018 23:16 — forked from wch/unlockEnvironment.r
Sample code for unlocking environments in R
library(inline)
inc <- '
/* This is taken from envir.c in the R 2.15.1 source
https://github.com/SurajGupta/r-source/blob/master/src/main/envir.c
*/
#define FRAME_LOCK_MASK (1<<14)
#define FRAME_IS_LOCKED(e) (ENVFLAGS(e) & FRAME_LOCK_MASK)
#define UNLOCK_FRAME(e) SET_ENVFLAGS(e, ENVFLAGS(e) & (~ FRAME_LOCK_MASK))
'
#!/usr/bin/env Rscript
# 2018-06-04 11:26:12
# Automatically generated from R by autoparallel version 0.0.1
library(parallel)
nworkers = 2
timeout = 600