# notice that row 4 (id = 4, toid = 9) and row 8 (id = 9, toid = 4) is a loop.
test_data <- data.frame(id = c(1, 2, 3, 4, 6, 7, 8, 9),
toid = c(2, 3, 4, 9, 7, 8, 9, 4))
check_hy_graph(test_data)
Run the code above in your browser using DataLab