Sorry I'm still running into some issues. 
# blockpair code
blklook1 <- data.frame(Block1 = c(1, 5, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 43, 47)
,Block2 = c(2, 6, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 44, 48)
,Block3 = c(3, 7, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 45, 49)
,Block4 = c(4, 8, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 46, 50))
library(tidyverse)
blklook2 <- pivot_longer(blklook1,
cols = 1:4,
names_to = "blockpair",
values_to = "stimulus")
library(dplyr)
left_join(data, # put your data with Subject and Stimulus columns here
blklook2)
In the main dataframe, I already had a column called "stimulus", but I didn't have one called "blockpair". It doesn't seem to update and create the new column "blockpair" in the main dataframe, but I see the correct output in the console though?
Sorry if I'm overlooking anything... this seems simple, but I can't seem to get my head around it!
-- edit... I forgot to mention that block 1 & 3 and block 2 & 4 share some of the same values, so it ends up duplicating a row with both column values 1 & 3
e.g.
a row with stimulus 15 is duplicated with both column value "block 1" & "block3", when it should only be "block1"
and then..
another row with stimulus 15 is duplicated with both column value "block 1" & "block3", when it should only be "block3"