Load libraries

library(mosaic)
library(dplyr)
library(googledrive)
library(googlesheets4)
library(here)

Read in and process the data from this year’s survey.

memories <-read_sheet("https://docs.google.com/spreadsheets/d/1TpQKgBzFWKSpV3IyUcM6pcEXBkEvqcPteTYzs-2goRU/edit?usp=sharing")

# delete first 2 observations where I was testing the form
memories <- memories[-c(1:2),]

# Determine if data have been collect this year yet
newdat <- nrow(memories) > 1

Rename the variables and recode the Groups

names(memories)[2:5] <- c("Year", "Group", "CorrectWords", "InCorrectWords")
memories$Group <- ifelse(memories$Group == "Even", "Words", "Pictures")

Tell R that Group is a factor variable

memories$Group <- as.factor(memories$Group)
mean(CorrectWords~Group, data=memories)
 Pictures     Words 
13.000000  9.652174 
gf_boxplot(CorrectWords~Group, data=memories)

Side-by-side boxplots of correct number of words for each treatment group

mean(InCorrectWords~Group, data=memories)
Pictures    Words 
2.000000 0.826087 
gf_boxplot(InCorrectWords~Group, data=memories)

Side-by-side boxplots of incorrectly remembered words for each treatment group

Write out the data

write.csv(memories, file = "data/Memories2026.csv", row.names = FALSE)

Compare to past years

memories2025<-read.csv(here("ClassActivities/data", "Memories2025.csv"))
memories2025$Group <- as.factor(memories2025$Group)
mean(CorrectWords~Group, data=memories2025)
Pictures    Words 
14.05263 10.56522 
gf_boxplot(CorrectWords~Group, data=memories2025)