Skip to content

Instantly share code, notes, and snippets.

View softloud's full-sized avatar

Charles T. Gray softloud

View GitHub Profile
@gadenbuie
gadenbuie / join-animations-with-gganimate.R
Last active January 11, 2022 15:48
Animated dplyr joins with gganimate
# Animated dplyr joins with gganimate
# * Garrick Aden-Buie
# * garrickadenbuie.com
# * MIT License: https://opensource.org/licenses/MIT
# Note: I used Fira Sans and Fira Mono fonts.
# Use search and replace to use a different font if Fira is not available.
library(tidyverse)
library(gganimate)
library(rlang)
library(purrr, warn.conflicts = FALSE)
a <- 2
b <- 5
fn_dots <- function(...) {
# capture `...` without evaluating
# (also captures the environment so we know how to
# evaluate them when the time comes)
@debruine
debruine / within_check.R
Last active September 12, 2021 18:54
Check possible p, t, and SD of difference score for within-subject means and SDs over a range of r-values
library(dplyr)
library(faux)
library(tidyr)
library(purrr)
library(ggplot2)
library(glue)
within_t <- function(n = 100, mu1 = 0, mu2 = 0, sd1 = 1, sd2 = 1, r = 0,
alternative = c("two.sided", "less", "greater")) {
x <- faux::rnorm_multi(n = n,