Skip to content

Commit

Permalink
Make 'relation' edge-attribute lambda default
Browse files Browse the repository at this point in the history
As the 'relation' edge-attribute can only be singular values if
'simplify.multiple.relations' is not set, we can set the previously
introduced lambda as default.

This works towards #251.

Signed-off-by: Maximilian Löffler <s8maloef@stud.uni-saarland.de>
  • Loading branch information
MaLoefUDS committed Mar 7, 2024
1 parent 3451641 commit 78f4351
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions util-networks.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ EDGE.ATTR.HANDLING = list(
## network-analytic data
weight = "sum",
type = "first",
relation = "first",
relation = function(relation) sort(unique(relation)),

## commit data
changed.files = "sum",
Expand Down Expand Up @@ -1621,9 +1621,7 @@ simplify.network = function(network, remove.multiple = TRUE, remove.loops = TRUE
## merge the simplified networks
network = merge.networks(networks)
} else {
relation.handling = function(relation) sort(unique(relation))
edge.attr.handling = modifyList(EDGE.ATTR.HANDLING, list(relation = relation.handling))
network = igraph::simplify(network, edge.attr.comb = edge.attr.handling,
network = igraph::simplify(network, edge.attr.comb = EDGE.ATTR.HANDLING,
remove.multiple = remove.multiple, remove.loops = remove.loops)
}

Expand Down

0 comments on commit 78f4351

Please sign in to comment.