I hereby claim:
- I am aaronpeikert on github.
- I am aaronpeikert (https://keybase.io/aaronpeikert) on keybase.
- I have a public key ASD1vjoYnsYfLP9Q6-rFsqwRWGdgMuMg8tY1XHobVZ7SfQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
library(tidyverse) | |
sas <- tempfile() | |
download.file("http://psych.colorado.edu/~carey/Courses/PSYC7291/DataSets/Documentation/InterestDataDoc.txt", | |
sas) | |
sas <- read_lines(sas) | |
starts_with_spaces <- function(string){ | |
out <- seq_along(string) | |
for (i in out) { | |
if(grepl("^ ", string[i]))out[i] <- out[i-1] | |
} |
library(tidyverse) | |
library(lme4) | |
gen_level2 <- function(n = 30, offsetb0 = 0, scaleb0 = 1, offsetb1 = 0, scaleb1 = 1){ | |
unit <- tibble::tibble(b0 = rnorm(n, offsetb0, scaleb0), | |
b1 = rnorm(n, offsetb1, scaleb1)) | |
return(unit) | |
} | |
gen_level2() |
As promised, we get a little more practical and share our experience in creating "bulletproof" reproducible analyses. To that end, we get you started with RMarkdown, Git, Make and Docker. Even though we have the most experience in R, this workflow is perfectly compatible with other languages --- like Python or Julia --- and if there is interest, we go through how. We plan three sessions à two hours to tackle this but might spend an additional session on questions that arise as we go along.
string <- "Optional reference: @@reference2020 | |
```{r} | |
myiris <- read.csv('iris.csv') | |
``` | |
" | |
cat(cleancitations(string)) |
library(tidyverse) | |
# simulation -------------------------------------------------------------- | |
add_noise <- function(x, sd, scale = TRUE){ | |
out <- x + rnorm(length(x), sd = sd) | |
if(scale)out <- scale(out) | |
out | |
} | |
n <- 100 | |
twins_m <- |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/> | |
<script src="http://cmx.io/v/0.1/cmx.js"></script> | |
<body> | |
<scene id="scene1"> | |
<label t="translate(0,346)" pose="47,-15|3,-1"> | |
<tspan x="0" y="0em">Back in history...</tspan> | |
</label> | |
<actor t="translate(71,19) rotate(-2)" pose="-11,9|-1,114|-11,99|-11,89|-11,79|-11,59|-16,34|-21,9|-6,34|-1,9|-18,79|-18,59|-6,79|13,83"> |
skip_weekend <- | |
function(datetime = lubridate::now(), | |
day_over = lubridate::hm("18:40")) { | |
stopifnot(lubridate::is.timepoint(datetime)) | |
date <- lubridate::date(datetime) | |
time <- hms::as_hms(datetime) | |
is.wday <- function(date, what) { | |
lubridate::wday(date, label = TRUE) %in% what | |
} | |
if (is.wday(date, "Fri") & (time > day_over)) |