Skip to content

Commit 4b6253d

Browse files
committed
igraph_match_arg
1 parent f96db77 commit 4b6253d

32 files changed

+110
-110
lines changed

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150

151151
- Rm useless error message (#1998).
152152

153-
- Improve `igraph.match.arg()` (#1996).
153+
- Improve `igraph_match_arg()` (#1996).
154154

155155

156156
# igraph 2.1.4.9068
@@ -1871,7 +1871,7 @@ See <https://github.com/igraph/rigraph/blob/05973441b83decdeab8cc9c500a642c00b92
18711871

18721872
- Breaking change: remove tkigraph from {igraph} proper (#1474).
18731873
- Breaking change: Hard-deprecate `get.edge()` and `layout.grid.3d()` which have been deprecated for 10 years (#1398).
1874-
- Breaking change: use `rlang::arg_match()` in `igraph.match.arg()` (#1165).
1874+
- Breaking change: use `rlang::arg_match()` in `igraph_match_arg()` (#1165).
18751875

18761876
### In-progress deprecations
18771877

R/adjacency.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ graph_from_adjacency_matrix <- function(
290290
add.rownames = NA
291291
) {
292292
ensure_no_na(adjmatrix, "adjacency matrix")
293-
mode <- igraph.match.arg(mode)
293+
mode <- igraph_match_arg(mode)
294294

295295
if (!is.matrix(adjmatrix) && !inherits(adjmatrix, "Matrix")) {
296296
lifecycle::deprecate_soft(
@@ -415,7 +415,7 @@ graph.adjacency.dense <- function(
415415
if (is.logical(diag)) {
416416
diag <- ifelse(diag, "once", "ignore")
417417
}
418-
diag <- igraph.match.arg(diag)
418+
diag <- igraph_match_arg(diag)
419419
diag <- switch(diag, "ignore" = 0L, "twice" = 1L, "once" = 2L)
420420

421421
if (nrow(adjmatrix) != ncol(adjmatrix)) {

R/bipartite.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ bipartite_projection <- function(
179179
probe1 <- -1
180180
}
181181
which <- switch(
182-
igraph.match.arg(which),
182+
igraph_match_arg(which),
183183
"both" = 0L,
184184
"false" = 1L,
185185
"true" = 2L

R/centrality.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ closeness <- function(
593593

594594
vids <- as_igraph_vs(graph, vids)
595595
mode <- switch(
596-
igraph.match.arg(mode),
596+
igraph_match_arg(mode),
597597
"out" = 1,
598598
"in" = 2,
599599
"all" = 3,
@@ -1371,7 +1371,7 @@ eigen_centrality <- function(
13711371
}
13721372
}
13731373

1374-
mode <- igraph.match.arg(mode)
1374+
mode <- igraph_match_arg(mode)
13751375

13761376
if (lifecycle::is_present(directed)) {
13771377
if (directed) {

R/centralization.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ centr_eigen <- function(
690690
)
691691
}
692692

693-
mode <- igraph.match.arg(mode)
693+
mode <- igraph_match_arg(mode)
694694

695695
if (lifecycle::is_present(directed)) {
696696
if (directed) {
@@ -766,7 +766,7 @@ centr_eigen_tmax <- function(
766766
The argument will be removed in the future."
767767
)
768768
}
769-
mode <- igraph.match.arg(mode)
769+
mode <- igraph_match_arg(mode)
770770

771771
if (lifecycle::is_present(directed)) {
772772
if (directed) {

R/community.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,10 +1485,10 @@ cluster_spinglass <- function(
14851485
weights <- NULL
14861486
}
14871487

1488-
update.rule <- igraph.match.arg(update.rule)
1488+
update.rule <- igraph_match_arg(update.rule)
14891489
update.rule <- switch(update.rule, "simple" = 0, "random" = 0, "config" = 1)
14901490
implementation <- switch(
1491-
igraph.match.arg(implementation),
1491+
igraph_match_arg(implementation),
14921492
"orig" = 0,
14931493
"neg" = 1
14941494
)
@@ -1662,7 +1662,7 @@ cluster_leiden <- function(
16621662
ensure_igraph(graph)
16631663

16641664
# Parse objective function argument
1665-
objective_function <- igraph.match.arg(objective_function)
1665+
objective_function <- igraph_match_arg(objective_function)
16661666
objective_function <- switch(objective_function, "cpm" = 0, "modularity" = 1)
16671667

16681668
# Parse edge weights argument
@@ -2419,8 +2419,8 @@ cluster_label_prop0 <- function(
24192419
ensure_igraph(graph)
24202420

24212421
# Necessary because evaluated later
2422-
mode <- igraph.match.arg(mode)
2423-
lpa_variant <- igraph.match.arg(lpa_variant)
2422+
mode <- igraph_match_arg(mode)
2423+
lpa_variant <- igraph_match_arg(lpa_variant)
24242424

24252425
# Function call
24262426
membership <- community_label_propagation_impl(
@@ -2828,7 +2828,7 @@ plot_dendrogram.communities <- function(
28282828
use.modularity = FALSE,
28292829
palette = categorical_pal(8)
28302830
) {
2831-
mode <- igraph.match.arg(mode, c("auto", "phylo", "hclust", "dendrogram"))
2831+
mode <- igraph_match_arg(mode, c("auto", "phylo", "hclust", "dendrogram"))
28322832

28332833
old_palette <- palette(palette)
28342834
on.exit(palette(old_palette), add = TRUE)
@@ -3062,7 +3062,7 @@ i_compare <- function(
30623062
} else {
30633063
as.numeric(as.factor(comm2))
30643064
}
3065-
method <- igraph.match.arg(method)
3065+
method <- igraph_match_arg(method)
30663066
res <- compare_communities_impl(
30673067
comm1 = comm1,
30683068
comm2 = comm2,

R/components.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ decompose <- function(
203203
min.vertices = 0
204204
) {
205205
ensure_igraph(graph)
206-
mode <- igraph.match.arg(mode)
206+
mode <- igraph_match_arg(mode)
207207
mode <- switch(mode, "weak" = 1L, "strong" = 2L)
208208

209209
if (is.na(max.comps)) {

R/conversion.R

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ get.adjacency.dense <- function(
229229
) {
230230
ensure_igraph(graph)
231231

232-
type <- igraph.match.arg(type)
232+
type <- igraph_match_arg(type)
233233

234234
if (is.logical(loops)) {
235235
loops <- ifelse(loops, "once", "ignore")
@@ -242,7 +242,7 @@ get.adjacency.dense <- function(
242242
)
243243
)
244244
}
245-
loops <- igraph.match.arg(loops)
245+
loops <- igraph_match_arg(loops)
246246
loops <- switch(loops, "ignore" = 0L, "twice" = 1L, "once" = 2L)
247247

248248
if (!is.null(weights)) {
@@ -285,7 +285,7 @@ get.adjacency.sparse <- function(
285285
) {
286286
ensure_igraph(graph)
287287

288-
type <- igraph.match.arg(type)
288+
type <- igraph_match_arg(type)
289289

290290
vc <- vcount(graph)
291291

@@ -624,7 +624,7 @@ as_undirected <- function(
624624
) {
625625
# Argument checks
626626
ensure_igraph(graph)
627-
mode <- igraph.match.arg(mode)
627+
mode <- igraph_match_arg(mode)
628628

629629
# Function call
630630
res <- to_undirected_impl(
@@ -685,9 +685,9 @@ as_adj_list <- function(
685685
) {
686686
ensure_igraph(graph)
687687

688-
mode <- igraph.match.arg(mode)
688+
mode <- igraph_match_arg(mode)
689689
mode <- as.numeric(switch(mode, "out" = 1, "in" = 2, "all" = 3, "total" = 3))
690-
loops <- igraph.match.arg(loops)
690+
loops <- igraph_match_arg(loops)
691691
loops <- as.numeric(switch(loops, "ignore" = 0, "twice" = 1, "once" = 2))
692692

693693
if (is_directed(graph) && loops == 1) {
@@ -716,9 +716,9 @@ as_adj_edge_list <- function(
716716
) {
717717
ensure_igraph(graph)
718718

719-
mode <- igraph.match.arg(mode)
719+
mode <- igraph_match_arg(mode)
720720
mode <- as.numeric(switch(mode, "out" = 1, "in" = 2, "all" = 3, "total" = 3))
721-
loops <- igraph.match.arg(loops)
721+
loops <- igraph_match_arg(loops)
722722
loops <- as.numeric(switch(loops, "ignore" = 0, "twice" = 1, "once" = 2))
723723

724724
if (is_directed(graph) && loops == 1) {
@@ -1186,7 +1186,7 @@ as_incidence_matrix <- function(...) {
11861186
#' @export
11871187
as_data_frame <- function(x, what = c("edges", "vertices", "both")) {
11881188
ensure_igraph(x)
1189-
what <- igraph.match.arg(what)
1189+
what <- igraph_match_arg(what)
11901190

11911191
if (what %in% c("vertices", "both")) {
11921192
ver <- .Call(

R/epi.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ median.sir <- function(x, na.rm = FALSE, ...) {
6868
#' @export
6969
quantile.sir <- function(x, comp = c("NI", "NS", "NR"), prob, ...) {
7070
sir <- x
71-
comp <- toupper(igraph.match.arg(comp))
71+
comp <- toupper(igraph_match_arg(comp))
7272
times <- unlist(sapply(sir, "[[", "times"))
7373
big.N <- unlist(sapply(sir, function(x) {
7474
x[[comp]]
@@ -159,7 +159,7 @@ plot.sir <- function(
159159
) {
160160
sir <- x
161161

162-
comp <- toupper(igraph.match.arg(comp))
162+
comp <- toupper(igraph_match_arg(comp))
163163
if (!all(quantiles >= 0 & quantiles <= 1)) {
164164
cli::cli_abort("All {.arg quantiles} should be in [0,1].")
165165
}

R/fit.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ fit_power_law <- function(
190190
p.precision = NULL,
191191
...
192192
) {
193-
implementation <- igraph.match.arg(implementation)
193+
implementation <- igraph_match_arg(implementation)
194194

195195
if (implementation == "r.mle") {
196196
if (isTRUE(p.value)) {

0 commit comments

Comments
 (0)