Closed mbojan closed 3 years ago
hmm looks like an issue when the vertex with the highest id is an isolate.
line 91-93 and 95 in as_sparse6.R
Indeed, I think the current code here
https://github.com/mbojan/rgraph6/blob/017715950822a917605a2fcac81d7c9482cb8df8/R/as_sparse6.R#L38
and further down here
https://github.com/mbojan/rgraph6/blob/017715950822a917605a2fcac81d7c9482cb8df8/R/as_sparse6.R#L67
silently assumes the network is connected by taking the network size beeing the max vertex id appearing in the edgelist.
I think the as_sparse6.matrix()
requires an extra argument for the size of the vertex set.
I'm adding:
n
argument to as_sparse6.matrix()
expecting network sizeedgelist_from_sparse6()
returns the edge list with gorder
attribute storing the network size Ad 1. I don't think to make sense for n
to have any default
Ad 2. The attribute is consumed by igraph- and network-making functions.