From 78f43514962d7651e6b7a1e80ee22ce012f32535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20L=C3=B6ffler?= Date: Thu, 7 Mar 2024 16:40:00 +0100 Subject: [PATCH] Make 'relation' edge-attribute lambda default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- util-networks.R | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/util-networks.R b/util-networks.R index f7f7ddf9..37abd758 100644 --- a/util-networks.R +++ b/util-networks.R @@ -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", @@ -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) }