I am working on some inter-coder reliability analyses for my dissertation meta-analysis. Myself ("TM") and another coder ("AY") coded data from a couple hundred study documents. I want to be able to create a function that allows me to enter in the study-document ID as an argument and then have the function output tell me whether or not there was a discrepancy in the coding decisions ("Funding," "Data") between myself and the other coder. I want to do something like the following, but I can't get the function to work.
df <- tibble( ID = c( rep(1, 4), rep(2, 4)), Coder1 = c( rep( paste("TM"), 8)), Coder2 = c( rep( paste("AY"), 8)), Funding1 = rep(1, 8), Funding2 = c( rep(1, 4), rep(0, 4)), Data1 = c( rep(1, 4), rep(0, 4)), Data2 = rep(1, 8) ) ndf <- df %>% filter(ID == 1) #> I want to be able to enter the study ID (the document number) unique( ndf$Funding1 == ndf$Funding2) #> And then have the function output whether or not unique( ndf$Data1 == ndf$Data2) #> we agreed/disagreed on a coding decision