From a2ecb5784a5854c1992ccecd43e7aa922ba96ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 7 Oct 2024 10:25:45 +0200 Subject: [PATCH] fix: put deprecation message at the beginning not the end of the similarity functions --- R/similarity.R | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/R/similarity.R b/R/similarity.R index 174f8d6eae..3c578e7381 100644 --- a/R/similarity.R +++ b/R/similarity.R @@ -83,13 +83,6 @@ similarity.jaccard <- function(graph, vids = V(graph), mode = c("all", "out", "in", "total"), loops = FALSE) { - similarity( - graph = graph, - vids = vids, - mode = mode, - loops = loops, - method = "jaccard" - ) lifecycle::deprecate_soft( "2.1.0", @@ -97,6 +90,14 @@ similarity.jaccard <- function(graph, 'similarity(method)', details = 'similarity(method = "jaccard")' ) + + similarity( + graph = graph, + vids = vids, + mode = mode, + loops = loops, + method = "jaccard" + ) } #' Similarity measures of two vertices (Dice) @@ -112,13 +113,6 @@ similarity.dice <- function(graph, vids = V(graph), mode = c("all", "out", "in", "total"), loops = FALSE) { - similarity( - graph = graph, - vids = vids, - mode = mode, - loops = loops, - method = "dice" - ) lifecycle::deprecate_soft( "2.1.0", @@ -126,6 +120,14 @@ similarity.dice <- function(graph, 'similarity(method)', details = 'similarity(method = "dice")' ) + + similarity( + graph = graph, + vids = vids, + mode = mode, + loops = loops, + method = "dice" + ) } #' Similarity measures of two vertices (inverse log-weighted) @@ -140,12 +142,6 @@ similarity.dice <- function(graph, similarity.invlogweighted <- function(graph, vids = V(graph), mode = c("all", "out", "in", "total")) { - similarity( - graph = graph, - vids = vids, - mode = mode, - method = "invlogweighted" - ) lifecycle::deprecate_soft( "2.1.0", @@ -153,4 +149,11 @@ similarity.invlogweighted <- function(graph, 'similarity(method)', details = 'similarity(method = "invlogweighted")' ) + + similarity( + graph = graph, + vids = vids, + mode = mode, + method = "invlogweighted" + ) }