diff --git a/R/neuron.R b/R/neuron.R index 743d0e1b..7172cf16 100644 --- a/R/neuron.R +++ b/R/neuron.R @@ -1419,7 +1419,8 @@ distal_to <- function(x, node.idx=NULL, node.pointno=NULL, root.idx=NULL, dfs_traversal <- function(x, g) { gdfs=igraph::dfs(g, root = x, unreachable = FALSE) - as.integer(gdfs$order)[!is.na(gdfs$order)] + # nb igraph 2.0 may change signalling for unreached nodes + as.integer(gdfs$order)[!(is.na(gdfs$order) | gdfs$order<1)] } diff --git a/R/ngraph.R b/R/ngraph.R index 3f1d5f47..4e856d77 100644 --- a/R/ngraph.R +++ b/R/ngraph.R @@ -539,6 +539,8 @@ prune_vertices<-function(x, verticestoprune, invert=FALSE, ...) { if(invert) { nvertices=igraph::vcount(g) verticestoprune=setdiff(seq_len(nvertices), verticestoprune) + } else { + verticestoprune=setdiff(verticestoprune, 0) } dg=igraph::delete_vertices(g, verticestoprune) # delete_vertices will return an igraph