inst/roxygen-examples/find_adjacencies-example.R

# Small toy adjacency (from-to)
amat <- matrix(0, 3, 3, dimnames = list(c("A", "B", "C"), c("A", "B", "C")))
# A --> B, C --> B
amat["A", "B"] <- 1
amat["C", "B"] <- 1

# Adjacent to B (both incoming and outgoing considered)
find_adjacencies(amat, 2L) # indices of A and C (1, 3)

Try the causalDisco package in your browser

Any scripts or data that you put into this service are public.

causalDisco documentation built on April 13, 2026, 5:06 p.m.