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
StatEndpoint <- ggproto("StatEndpoint", Stat, | |
compute_group = function(data, scales) { | |
# sort by x so indexing is meaningful | |
data = arrange(data, x) | |
# grab only the first and last row | |
data[c(1,nrow(data)),] | |
}, | |
required_aes = c("x", "y") | |
) |
We can't make this file beautiful and searchable because it's too large.
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
x,y,value | |
1,205,0.3125 | |
1,204,0.3125 | |
1,203,0.3125 | |
1,202,0.3125 | |
1,201,0.3125 | |
1,200,0.3125 | |
1,199,0.3125 | |
1,198,0.3125 | |
1,197,0.3125 |
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(tidyverse) | |
set.seed(999) | |
data = tibble( | |
name = c("A1", "A2", "A3", "A4", "B1", "B2", "B3", "B4", "C1", "C2"), | |
value = rnorm(10, 10, sd = 3), | |
color = c( | |
hcl(220, seq(60, 30, -10), seq(50, 80, 10)), | |
hcl(0, seq(60, 30, -10), seq(50, 80, 10)), |
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(tidyverse) | |
# arbitrary number | |
district_count = 38 | |
# population from stephanie's figure | |
# https://twitter.com/evergreendata/status/1450862060972216320 | |
population = c( | |
rep("White", 40), | |
rep("Latino", 39), |
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(tidyverse) | |
library(magrittr) | |
library(afex) | |
library(Superpower) | |
set.seed(555) | |
SUBJECT_COUNT = 3 # per between-subject condition | |
#### ground-truth parameters for 3w x 2w x 2b (100 repetitions) |
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(tidyverse) | |
library(ggdist) | |
# make some data | |
expand_grid( | |
condition = c("A", "B"), | |
stimulus = seq(-3,3,0.3), | |
repetitions = 1:20 | |
) %>% | |
# make some noisy response data |
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
reference: https://dplyr.tidyverse.org/reference/storms.html | |
visualization: https://imgur.com/a/TMONnmS | |
source: https://www.nhc.noaa.gov/data/#hurdat |
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(tidyverse) | |
PATH = "peerj_reviews_txt/" | |
ignored_words = c("the", "dear", "original") | |
filenames = dir(path = PATH, pattern="*.txt", recursive = TRUE) | |
preceeding_words = sapply(filenames, function(f) { | |
words = read_file(paste0(PATH, f)) %>% |
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
subject | x | color | rep | y | |
---|---|---|---|---|---|
H | 1 | 0 | 1 | 10.390916389674972 | |
J | 1 | 0 | 1 | 11.877635692199044 | |
A | 1 | 0 | 1 | 6.40831056135098 | |
G | 1 | 0 | 1 | 10.143656530161934 | |
F | 1 | 0 | 1 | 9.858462287495191 | |
B | 1 | 0 | 1 | 8.726973066068064 | |
C | 1 | 0 | 1 | 9.09479144777112 | |
D | 1 | 0 | 1 | 9.689029831578754 | |
E | 1 | 0 | 1 | 9.806302728246905 |