From 735628d15f0a7c9be261520ccc3142b2d6ce452a Mon Sep 17 00:00:00 2001 From: Gregory Jefferis Date: Sat, 20 Jan 2024 15:40:09 +0000 Subject: [PATCH] igraph tweaks & typos --- R/neuron.R | 2 +- R/ngraph.R | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/neuron.R b/R/neuron.R index c62289d0..6850b50f 100644 --- a/R/neuron.R +++ b/R/neuron.R @@ -1411,7 +1411,7 @@ distal_to <- function(x, node.idx=NULL, node.pointno=NULL, root.idx=NULL, g=as.directed.usingroot(gorig, root = root.idx) } - #Step3: For each node id, travese the graph from the given node using depth first search and return the visited + #Step3: For each node id, traverse the graph from the given node using depth first search and return the visited #nodes.. l=sapply(node.idx, dfs_traversal, g, simplify = FALSE) if(length(node.idx)==1) l[[1]] else l diff --git a/R/ngraph.R b/R/ngraph.R index f837e82a..3f1d5f47 100644 --- a/R/ngraph.R +++ b/R/ngraph.R @@ -533,11 +533,11 @@ prune_strahler<-function(x, orderstoprune=1:2, ...) { prune_vertices<-function(x, verticestoprune, invert=FALSE, ...) { g=as.ngraph(x) - # because igraph.vs sequences are atttached to a specific graph + # because igraph.vs sequences are attached to a specific graph if(inherits(verticestoprune, "igraph.vs")) verticestoprune=as.integer(verticestoprune) if(invert) { - nvertices=nrow(xyzmatrix(x)) + nvertices=igraph::vcount(g) verticestoprune=setdiff(seq_len(nvertices), verticestoprune) } dg=igraph::delete_vertices(g, verticestoprune)