I just wonder if there is a way to find all subordinates of a manager. In below example, the person in p2 reports to the person in P1. I want to find all the persons report to A. If I use below code, I can get A->B A->C. But what I want is A->B A->C A->D. Is it possible?
d <- data.frame(p1=c('A', 'A', 'C'),
p2=c('B', 'C', 'D'))
library(igraph)
g <- graph.data.frame(d, directed=T)
print(g, e=TRUE, v=TRUE)
E(g)[from(V(g)["A"])]