cg <- caugi(
A %-->% B,
B %-->% C,
class = "DAG"
)
descendants(cg, "A") # "B" "C"
descendants(cg, index = 2) # "C"
descendants(cg, "B") # "C"
descendants(cg, c("B", "C"))
#> $B
#> [1] "C"
#>
#> $C
#> NULL
Run the code above in your browser using DataLab