For your specific question, see this section of the article:
and in brief if you have a neuron, n
n=Cell07PNs[[1]]
ng=as.ngraph(n, weights=TRUE)
igraph::distances(ng, v=180, to=1)
note that in this case node indices (i.e. values between 1 and N, the number of nodes in the neuron) are being used.
You can also use the CATMAID id of the vertex (arbitrary integer). In that case you need to quote the ids (because they are used as the names of the nodes in the ngraph representation).
dl4=read.neurons.catmaid('glomerulus DL4 right')
ng=as.ngraph(dl4[[1]], weights=TRUE)
igraph::distances(ng, v=1, to=20)
igraph::distances(ng, v='7737299', to='44767283')
The whole article I mention above is worth a read and you can also look at this section of the function reference
Best wishes,
Greg.