I do not understand what it means to "agree on a coding decision" since the each ID appears four times in your data.
library(tibble)
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)
)
df
#> # A tibble: 8 x 7
#> ID Coder1 Coder2 Funding1 Funding2 Data1 Data2
#> <dbl> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 1 TM AY 1 1 1 1
#> 2 1 TM AY 1 1 1 1
#> 3 1 TM AY 1 1 1 1
#> 4 1 TM AY 1 1 1 1
#> 5 2 TM AY 1 0 0 1
#> 6 2 TM AY 1 0 0 1
#> 7 2 TM AY 1 0 0 1
#> 8 2 TM AY 1 0 0 1
Created on 2019-05-21 by the reprex package (v0.2.1)
Do you want the function to say whether the two coders agreed every time on ID == 1, or they agreed n out of m times, or something else?