I have the following data
library(data.table); library(igraph)
t <- data.table(a=seq(ISOdate(2019,1,1), ISOdate(2019,7,1), "months"),
b=seq(ISOdate(2019,1,2), ISOdate(2019,7,2), "months"))
g <- graph_from_edgelist(as.matrix(t[,c("a","b")]))
and would like to apply subcomponent(g,ISOdate(2019,1,1),"out")
but obtain the error that
At structural_properties.c:1249 : subcomponent failed, Invalid vertex id
Is anyone aware of a solution to this problem?
Additional complication
The problem is complicated when I have an additional variable
start <- seq(ISOdate(2019,1,1), ISOdate(2019,7,1), "months")[c(1,3,5,7)]
that contains different starting vertices. Again, subcomponent(g,start,"out")
gives the error above. Is there a workaround, similar to Ben's suggestion in the comments for the case above?