Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Attempt to reproduce Maglio & Polman (2014) Figure 1
## Get file off OSF
tf = tempfile(fileext = ".xlsx")
download.file(url = "https://osf.io/846cb/download", destfile = tf)
## Create summaries
library(tidyverse)
readxl::read_xlsx(tf) %>%
group_by(STN_NUMBER, DIRECTION) %>%
summarise(
N = n(),
M = mean(DISTANCE),
SD = sd(DISTANCE),
SE = SD/sqrt(N)) -> sum_data
## Print summaries - I cross-checked these with SPSS
sum_data
## Create plot - I cross-checked this with SPSS
sum_data %>%
ggplot(aes(x = STN_NUMBER, y = M, group = DIRECTION, color = DIRECTION)) +
geom_line() + geom_point() +
geom_errorbar(aes(ymin=M-SE,ymax=M+SE), width = .1) +
ylim(c(0,5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.