full <- rbind(c(0, 1, 1, 1),
c(0, 0, 1, 1),
c(0, 0, 0, 1),
c(0, 0, 0, 0))
chain <- rbind(c(0, 1, 0, 0),
c(0, 0, 1, 0),
c(0, 0, 0, 1),
c(0, 0, 0, 0))
identical(parent_aid(full, chain, "from row to column"), c(4/12, 4))
Run the code above in your browser using DataLab