diff --git a/ccn2019.Rmd b/ccn2019.Rmd index 8cb92cc..efba46c 100644 --- a/ccn2019.Rmd +++ b/ccn2019.Rmd @@ -105,8 +105,17 @@ ifelse(stim==lag1 || stim==lag3, T, F) } +create_history <- function(stims, max=4) { + res <- c('') + for (i in 2:length(stims)) { + res[i] <- str_sub(paste(res[i-1], stims[i], sep=''),-max,-1) + } + res +} NB %>% + group_by(participant, condition, block) %>% + mutate(history = create_history(stimulus)) %>% mutate( lure = map_chr( stimulus,