luukvdmeer / sfnetworks

Tidy Geospatial Networks in R
https://luukvdmeer.github.io/sfnetworks/
Other
338 stars 20 forks source link

Test of directedness could happen outside the find_edges function #185

Closed Anaphory closed 2 years ago

Anaphory commented 2 years ago

Currently, the lapply in https://github.com/luukvdmeer/sfnetworks/blob/906f423c2594313a67b89aeaecc4ed561a86c396/R/morphers.R#L667 calls a function which in every call – i.e. for every subgraph (at least not for every edge, as I originally thought) – tests whether the graph is directed or not: https://github.com/luukvdmeer/sfnetworks/blob/906f423c2594313a67b89aeaecc4ed561a86c396/R/morphers.R#L583-L589 Would it not make sense to define find_edges differently for directed and undirected graphs, ie. essentially swapping lines 583 and 589 (with a copy of line 583 in the else, between 625 and 626)?

luukvdmeer commented 2 years ago

Fixed in v0.6.0