diff --git a/R/adjacency.R b/R/adjacency.R index 5b8bc9681ad..0e53d2db452 100644 --- a/R/adjacency.R +++ b/R/adjacency.R @@ -299,7 +299,7 @@ graph_from_adjacency_matrix <- function( "graph_from_adjacency_matrix" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( mode = mode, weighted = weighted, @@ -339,12 +339,14 @@ graph_from_adjacency_matrix <- function( head_args = c("adjmatrix"), fn_name = "graph_from_adjacency_matrix" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -467,7 +469,7 @@ from_adjacency <- function( "from_adjacency" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( mode = mode, weighted = weighted, @@ -507,12 +509,14 @@ from_adjacency <- function( head_args = c("adjmatrix"), fn_name = "from_adjacency" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/assortativity.R b/R/assortativity.R index 448b34bcc44..78203878f29 100644 --- a/R/assortativity.R +++ b/R/assortativity.R @@ -251,7 +251,7 @@ assortativity_nominal <- function( # BEGIN GENERATED ARG_HANDLE: assortativity_nominal, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, normalized = normalized), recover_new = c("directed", "normalized"), recover_old = c("directed", "normalized"), @@ -261,12 +261,14 @@ assortativity_nominal <- function( head_args = c("graph", "types"), fn_name = "assortativity_nominal" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -294,7 +296,7 @@ assortativity_degree <- function( # BEGIN GENERATED ARG_HANDLE: assortativity_degree, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -304,12 +306,14 @@ assortativity_degree <- function( head_args = c("graph"), fn_name = "assortativity_degree" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/bipartite.R b/R/bipartite.R index 07b1e6364b2..279ae8de2bb 100644 --- a/R/bipartite.R +++ b/R/bipartite.R @@ -172,7 +172,7 @@ bipartite_projection <- function( # BEGIN GENERATED ARG_HANDLE: bipartite_projection, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( multiplicity = multiplicity, probe1 = probe1, @@ -192,12 +192,14 @@ bipartite_projection <- function( head_args = c("graph", "types"), fn_name = "bipartite_projection" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/centrality.R b/R/centrality.R index ec70be7fb7f..a87952fbd7e 100644 --- a/R/centrality.R +++ b/R/centrality.R @@ -441,7 +441,7 @@ betweenness <- function( # BEGIN GENERATED ARG_HANDLE: betweenness, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( directed = directed, weights = weights, @@ -461,12 +461,14 @@ betweenness <- function( head_args = c("graph", "v"), fn_name = "betweenness" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -508,7 +510,7 @@ edge_betweenness <- function( # BEGIN GENERATED ARG_HANDLE: edge_betweenness, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, weights = weights, cutoff = cutoff), recover_new = c("directed", "weights", "cutoff"), recover_old = c("directed", "weights", "cutoff"), @@ -518,12 +520,14 @@ edge_betweenness <- function( head_args = c("graph", "e"), fn_name = "edge_betweenness" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -649,7 +653,7 @@ closeness <- function( # BEGIN GENERATED ARG_HANDLE: closeness, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( mode = mode, weights = weights, @@ -669,12 +673,14 @@ closeness <- function( head_args = c("graph", "vids"), fn_name = "closeness" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1175,7 +1181,7 @@ subgraph_centrality <- function( # BEGIN GENERATED ARG_HANDLE: subgraph_centrality, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(diag = diag), recover_new = c("diag"), recover_old = c("diag"), @@ -1185,12 +1191,14 @@ subgraph_centrality <- function( head_args = c("graph"), fn_name = "subgraph_centrality" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1508,7 +1516,7 @@ strength <- function( # BEGIN GENERATED ARG_HANDLE: strength, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, loops = loops, weights = weights), recover_new = c("mode", "loops", "weights"), recover_old = c("mode", "loops", "weights"), @@ -1522,12 +1530,14 @@ strength <- function( head_args = c("graph", "vids"), fn_name = "strength" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1596,7 +1606,7 @@ diversity <- function( # BEGIN GENERATED ARG_HANDLE: diversity, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, vids = vids), recover_new = c("weights", "vids"), recover_old = c("weights", "vids"), @@ -1606,12 +1616,14 @@ diversity <- function( head_args = c("graph"), fn_name = "diversity" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1888,7 +1900,7 @@ page_rank <- function( # BEGIN GENERATED ARG_HANDLE: page_rank, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( algo = algo, vids = vids, @@ -1946,12 +1958,14 @@ page_rank <- function( head_args = c("graph"), fn_name = "page_rank" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2030,7 +2044,7 @@ harmonic_centrality <- function( # BEGIN GENERATED ARG_HANDLE: harmonic_centrality, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( mode = mode, weights = weights, @@ -2050,12 +2064,14 @@ harmonic_centrality <- function( head_args = c("graph", "vids"), fn_name = "harmonic_centrality" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2267,7 +2283,7 @@ power_centrality <- function( # BEGIN GENERATED ARG_HANDLE: power_centrality, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( loops = loops, exponent = exponent, @@ -2312,12 +2328,14 @@ power_centrality <- function( head_args = c("graph", "nodes"), fn_name = "power_centrality" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2492,7 +2510,7 @@ alpha_centrality <- function( # BEGIN GENERATED ARG_HANDLE: alpha_centrality, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( alpha = alpha, loops = loops, @@ -2516,12 +2534,14 @@ alpha_centrality <- function( head_args = c("graph", "nodes"), fn_name = "alpha_centrality" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/centralization.R b/R/centralization.R index 55f23fed069..f0d271f8f71 100644 --- a/R/centralization.R +++ b/R/centralization.R @@ -324,7 +324,7 @@ centralize <- function( # BEGIN GENERATED ARG_HANDLE: centralize, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( theoretical.max = theoretical.max, normalized = normalized @@ -337,12 +337,14 @@ centralize <- function( head_args = c("scores"), fn_name = "centralize" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -403,7 +405,7 @@ centr_degree <- function( # BEGIN GENERATED ARG_HANDLE: centr_degree, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, loops = loops, normalized = normalized), recover_new = c("mode", "loops", "normalized"), recover_old = c("mode", "loops", "normalized"), @@ -417,12 +419,14 @@ centr_degree <- function( head_args = c("graph"), fn_name = "centr_degree" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -535,7 +539,7 @@ centr_betw <- function( # BEGIN GENERATED ARG_HANDLE: centr_betw, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, normalized = normalized), recover_new = c("directed", "normalized"), recover_old = c("directed", "normalized"), @@ -545,12 +549,14 @@ centr_betw <- function( head_args = c("graph"), fn_name = "centr_betw" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -605,7 +611,7 @@ centr_betw_tmax <- function( # BEGIN GENERATED ARG_HANDLE: centr_betw_tmax, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -615,12 +621,14 @@ centr_betw_tmax <- function( head_args = c("graph", "nodes"), fn_name = "centr_betw_tmax" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -677,7 +685,7 @@ centr_clo <- function( # BEGIN GENERATED ARG_HANDLE: centr_clo, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, normalized = normalized), recover_new = c("mode", "normalized"), recover_old = c("mode", "normalized"), @@ -687,12 +695,14 @@ centr_clo <- function( head_args = c("graph"), fn_name = "centr_clo" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -737,7 +747,7 @@ centr_clo_tmax <- function( # BEGIN GENERATED ARG_HANDLE: centr_clo_tmax, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -747,12 +757,14 @@ centr_clo_tmax <- function( head_args = c("graph", "nodes"), fn_name = "centr_clo_tmax" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/cliques.R b/R/cliques.R index bb4425f6e4b..109f5ef6002 100644 --- a/R/cliques.R +++ b/R/cliques.R @@ -393,7 +393,7 @@ count_max_cliques <- function( # BEGIN GENERATED ARG_HANDLE: count_max_cliques, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(subset = subset), recover_new = c("subset"), recover_old = c("subset"), @@ -403,12 +403,14 @@ count_max_cliques <- function( head_args = c("graph", "min", "max"), fn_name = "count_max_cliques" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -505,7 +507,7 @@ weighted_cliques <- function( # BEGIN GENERATED ARG_HANDLE: weighted_cliques, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( vertex.weights = vertex.weights, min.weight = min.weight, @@ -525,12 +527,14 @@ weighted_cliques <- function( head_args = c("graph"), fn_name = "weighted_cliques" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -553,7 +557,7 @@ largest_weighted_cliques <- function( # BEGIN GENERATED ARG_HANDLE: largest_weighted_cliques, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(vertex.weights = vertex.weights), recover_new = c("vertex.weights"), recover_old = c("vertex.weights"), @@ -563,12 +567,14 @@ largest_weighted_cliques <- function( head_args = c("graph"), fn_name = "largest_weighted_cliques" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -588,7 +594,7 @@ weighted_clique_num <- function( # BEGIN GENERATED ARG_HANDLE: weighted_clique_num, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(vertex.weights = vertex.weights), recover_new = c("vertex.weights"), recover_old = c("vertex.weights"), @@ -598,12 +604,14 @@ weighted_clique_num <- function( head_args = c("graph"), fn_name = "weighted_clique_num" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -761,7 +769,7 @@ clique_size_counts <- function( # BEGIN GENERATED ARG_HANDLE: clique_size_counts, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(min = min, max = max, maximal = maximal), recover_new = c("min", "max", "maximal"), recover_old = c("min", "max", "maximal"), @@ -771,12 +779,14 @@ clique_size_counts <- function( head_args = c("graph"), fn_name = "clique_size_counts" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -844,7 +854,7 @@ is_clique <- function( # BEGIN GENERATED ARG_HANDLE: is_clique, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -854,12 +864,14 @@ is_clique <- function( head_args = c("graph", "candidate"), fn_name = "is_clique" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/cohesive.blocks.R b/R/cohesive.blocks.R index 3cd2c138fb1..8caa7b580cb 100644 --- a/R/cohesive.blocks.R +++ b/R/cohesive.blocks.R @@ -359,7 +359,7 @@ cohesive_blocks <- function( # BEGIN GENERATED ARG_HANDLE: cohesive_blocks, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(labels = labels), recover_new = c("labels"), recover_old = c("labels"), @@ -369,12 +369,14 @@ cohesive_blocks <- function( head_args = c("graph"), fn_name = "cohesive_blocks" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -631,7 +633,7 @@ export_pajek <- function( # BEGIN GENERATED ARG_HANDLE: export_pajek, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(project.file = project.file), recover_new = c("project.file"), recover_old = c("project.file"), @@ -641,12 +643,14 @@ export_pajek <- function( head_args = c("blocks", "graph", "file"), fn_name = "export_pajek" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/coloring.R b/R/coloring.R index c72315caee6..de4e1265cc9 100644 --- a/R/coloring.R +++ b/R/coloring.R @@ -39,7 +39,7 @@ greedy_vertex_coloring <- function( # BEGIN GENERATED ARG_HANDLE: greedy_vertex_coloring, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(heuristic = heuristic), recover_new = c("heuristic"), recover_old = c("heuristic"), @@ -49,12 +49,14 @@ greedy_vertex_coloring <- function( head_args = c("graph"), fn_name = "greedy_vertex_coloring" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/community.R b/R/community.R index d0849464d24..b34d442d59b 100644 --- a/R/community.R +++ b/R/community.R @@ -786,7 +786,7 @@ make_clusters <- function( "make_clusters" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( algorithm = algorithm, merges = merges, @@ -800,12 +800,14 @@ make_clusters <- function( head_args = c("graph", "membership"), fn_name = "make_clusters" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -984,7 +986,7 @@ modularity_matrix <- function( # BEGIN GENERATED ARG_HANDLE: modularity_matrix, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( weights = weights, resolution = resolution, @@ -998,12 +1000,14 @@ modularity_matrix <- function( head_args = c("graph", "membership"), fn_name = "modularity_matrix" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1561,7 +1565,7 @@ cluster_spinglass <- function( "cluster_spinglass" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( weights = weights, vertex = vertex, @@ -1643,12 +1647,14 @@ cluster_spinglass <- function( head_args = c("graph"), fn_name = "cluster_spinglass" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2040,7 +2046,7 @@ cluster_walktrap <- function( # BEGIN GENERATED ARG_HANDLE: cluster_walktrap, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( weights = weights, steps = steps, @@ -2062,12 +2068,14 @@ cluster_walktrap <- function( head_args = c("graph"), fn_name = "cluster_walktrap" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2208,7 +2216,7 @@ cluster_edge_betweenness <- function( # BEGIN GENERATED ARG_HANDLE: cluster_edge_betweenness, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( weights = weights, directed = directed, @@ -2266,12 +2274,14 @@ cluster_edge_betweenness <- function( head_args = c("graph"), fn_name = "cluster_edge_betweenness" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2372,7 +2382,7 @@ cluster_fast_greedy <- function( # BEGIN GENERATED ARG_HANDLE: cluster_fast_greedy, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( merges = merges, modularity = modularity, @@ -2392,12 +2402,14 @@ cluster_fast_greedy <- function( head_args = c("graph"), fn_name = "cluster_fast_greedy" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2829,7 +2841,7 @@ cluster_louvain <- function( # BEGIN GENERATED ARG_HANDLE: cluster_louvain, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, resolution = resolution), recover_new = c("weights", "resolution"), recover_old = c("weights", "resolution"), @@ -2839,12 +2851,14 @@ cluster_louvain <- function( head_args = c("graph"), fn_name = "cluster_louvain" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2948,7 +2962,7 @@ cluster_optimal <- function( # BEGIN GENERATED ARG_HANDLE: cluster_optimal, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights), recover_new = c("weights"), recover_old = c("weights"), @@ -2958,12 +2972,14 @@ cluster_optimal <- function( head_args = c("graph"), fn_name = "cluster_optimal" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3057,7 +3073,7 @@ cluster_infomap <- function( # BEGIN GENERATED ARG_HANDLE: cluster_infomap, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( e.weights = e.weights, v.weights = v.weights, @@ -3077,12 +3093,14 @@ cluster_infomap <- function( head_args = c("graph"), fn_name = "cluster_infomap" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/components.R b/R/components.R index 344edfce7a7..fc7597fdd84 100644 --- a/R/components.R +++ b/R/components.R @@ -207,7 +207,7 @@ decompose <- function( # BEGIN GENERATED ARG_HANDLE: decompose, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( mode = mode, max.comps = max.comps, @@ -225,12 +225,14 @@ decompose <- function( head_args = c("graph"), fn_name = "decompose" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -436,7 +438,7 @@ largest_component <- function( # BEGIN GENERATED ARG_HANDLE: largest_component, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -446,12 +448,14 @@ largest_component <- function( head_args = c("graph"), fn_name = "largest_component" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/conversion.R b/R/conversion.R index 28d218c7f28..342f3683446 100644 --- a/R/conversion.R +++ b/R/conversion.R @@ -453,7 +453,7 @@ as_adjacency_matrix <- function( # BEGIN GENERATED ARG_HANDLE: as_adjacency_matrix, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( weights = weights, names = names, @@ -475,12 +475,14 @@ as_adjacency_matrix <- function( head_args = c("graph", "type"), fn_name = "as_adjacency_matrix" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -575,7 +577,7 @@ as_edgelist <- function( # BEGIN GENERATED ARG_HANDLE: as_edgelist, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(names = names), recover_new = c("names"), recover_old = c("names"), @@ -585,12 +587,14 @@ as_edgelist <- function( head_args = c("graph"), fn_name = "as_edgelist" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -714,7 +718,7 @@ as_directed <- function( # BEGIN GENERATED ARG_HANDLE: as_directed, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -724,12 +728,14 @@ as_directed <- function( head_args = c("graph"), fn_name = "as_directed" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -821,7 +827,7 @@ as_adj_list <- function( # BEGIN GENERATED ARG_HANDLE: as_adj_list, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, loops = loops, multiple = multiple), recover_new = c("mode", "loops", "multiple"), recover_old = c("mode", "loops", "multiple"), @@ -835,12 +841,14 @@ as_adj_list <- function( head_args = c("graph"), fn_name = "as_adj_list" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -880,7 +888,7 @@ as_adj_edge_list <- function( # BEGIN GENERATED ARG_HANDLE: as_adj_edge_list, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, loops = loops), recover_new = c("mode", "loops"), recover_old = c("mode", "loops"), @@ -893,12 +901,14 @@ as_adj_edge_list <- function( head_args = c("graph"), fn_name = "as_adj_edge_list" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -978,7 +988,7 @@ graph_from_graphnel <- function( # BEGIN GENERATED ARG_HANDLE: graph_from_graphnel, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(name = name, weight = weight, unlist.attrs = unlist.attrs), recover_new = c("name", "weight", "unlist.attrs"), recover_old = c("name", "weight", "unlist.attrs"), @@ -988,12 +998,14 @@ graph_from_graphnel <- function( head_args = c("graphNEL"), fn_name = "graph_from_graphnel" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1327,7 +1339,7 @@ as_biadjacency_matrix <- function( # BEGIN GENERATED ARG_HANDLE: as_biadjacency_matrix, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( weights = weights, names = names, @@ -1347,12 +1359,14 @@ as_biadjacency_matrix <- function( head_args = c("graph", "types"), fn_name = "as_biadjacency_matrix" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1508,7 +1522,7 @@ graph_from_adj_list <- function( # BEGIN GENERATED ARG_HANDLE: graph_from_adj_list, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, duplicate = duplicate), recover_new = c("mode", "duplicate"), recover_old = c("mode", "duplicate"), @@ -1518,12 +1532,14 @@ graph_from_adj_list <- function( head_args = c("adjlist"), fn_name = "graph_from_adj_list" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1853,7 +1869,7 @@ graph_from_data_frame <- function( # BEGIN GENERATED ARG_HANDLE: graph_from_data_frame, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(vertices = vertices), recover_new = c("vertices"), recover_old = c("vertices"), @@ -1863,12 +1879,14 @@ graph_from_data_frame <- function( head_args = c("d", "directed"), fn_name = "graph_from_data_frame" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1983,7 +2001,7 @@ graph_from_edgelist <- function( # BEGIN GENERATED ARG_HANDLE: graph_from_edgelist, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -1993,12 +2011,14 @@ graph_from_edgelist <- function( head_args = c("el"), fn_name = "graph_from_edgelist" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/cycles.R b/R/cycles.R index 4d6c1d8d4b2..d129178b88a 100644 --- a/R/cycles.R +++ b/R/cycles.R @@ -58,7 +58,7 @@ find_cycle <- function( # BEGIN GENERATED ARG_HANDLE: find_cycle, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -68,12 +68,14 @@ find_cycle <- function( head_args = c("graph"), fn_name = "find_cycle" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/decomposition.R b/R/decomposition.R index 233ed25673b..5dcb3cb97d2 100644 --- a/R/decomposition.R +++ b/R/decomposition.R @@ -128,7 +128,7 @@ is_chordal <- function( # BEGIN GENERATED ARG_HANDLE: is_chordal, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( alpha = alpha, alpham1 = alpham1, @@ -148,12 +148,14 @@ is_chordal <- function( head_args = c("graph"), fn_name = "is_chordal" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/degseq.R b/R/degseq.R index 7be35794701..66880ea8558 100644 --- a/R/degseq.R +++ b/R/degseq.R @@ -149,7 +149,7 @@ is_graphical <- function( # BEGIN GENERATED ARG_HANDLE: is_graphical, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(allowed.edge.types = allowed.edge.types), recover_new = c("allowed.edge.types"), recover_old = c("allowed.edge.types"), @@ -161,12 +161,14 @@ is_graphical <- function( head_args = c("out.deg", "in.deg"), fn_name = "is_graphical" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/efficiency.R b/R/efficiency.R index 288d1fc86f1..8ab25b1f213 100644 --- a/R/efficiency.R +++ b/R/efficiency.R @@ -77,7 +77,7 @@ global_efficiency <- function( # BEGIN GENERATED ARG_HANDLE: global_efficiency, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, directed = directed), recover_new = c("weights", "directed"), recover_old = c("weights", "directed"), @@ -87,12 +87,14 @@ global_efficiency <- function( head_args = c("graph"), fn_name = "global_efficiency" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -117,7 +119,7 @@ local_efficiency <- function( # BEGIN GENERATED ARG_HANDLE: local_efficiency, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, directed = directed, mode = mode), recover_new = c("weights", "directed", "mode"), recover_old = c("weights", "directed", "mode"), @@ -131,12 +133,14 @@ local_efficiency <- function( head_args = c("graph", "vids"), fn_name = "local_efficiency" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -166,7 +170,7 @@ average_local_efficiency <- function( # BEGIN GENERATED ARG_HANDLE: average_local_efficiency, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, directed = directed, mode = mode), recover_new = c("weights", "directed", "mode"), recover_old = c("weights", "directed", "mode"), @@ -180,12 +184,14 @@ average_local_efficiency <- function( head_args = c("graph"), fn_name = "average_local_efficiency" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/embedding.R b/R/embedding.R index 77f324decc3..71e6f142ea2 100644 --- a/R/embedding.R +++ b/R/embedding.R @@ -117,7 +117,7 @@ embed_adjacency_matrix <- function( # BEGIN GENERATED ARG_HANDLE: embed_adjacency_matrix, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( weights = weights, which = which, @@ -139,12 +139,14 @@ embed_adjacency_matrix <- function( head_args = c("graph", "no"), fn_name = "embed_adjacency_matrix" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -334,7 +336,7 @@ embed_laplacian_matrix <- function( # BEGIN GENERATED ARG_HANDLE: embed_laplacian_matrix, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( weights = weights, which = which, @@ -356,12 +358,14 @@ embed_laplacian_matrix <- function( head_args = c("graph", "no"), fn_name = "embed_laplacian_matrix" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -420,7 +424,7 @@ sample_sphere_surface <- function( # BEGIN GENERATED ARG_HANDLE: sample_sphere_surface, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(radius = radius, positive = positive), recover_new = c("radius", "positive"), recover_old = c("radius", "positive"), @@ -430,12 +434,14 @@ sample_sphere_surface <- function( head_args = c("dim", "n"), fn_name = "sample_sphere_surface" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -487,7 +493,7 @@ sample_sphere_volume <- function( # BEGIN GENERATED ARG_HANDLE: sample_sphere_volume, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(radius = radius, positive = positive), recover_new = c("radius", "positive"), recover_old = c("radius", "positive"), @@ -497,12 +503,14 @@ sample_sphere_volume <- function( head_args = c("dim", "n"), fn_name = "sample_sphere_volume" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/epi.R b/R/epi.R index 7e90b1e8ccc..d18f5e4b38e 100644 --- a/R/epi.R +++ b/R/epi.R @@ -38,7 +38,7 @@ time_bins.sir <- function(x, ..., middle = TRUE) { # BEGIN GENERATED ARG_HANDLE: time_bins, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(middle = middle), recover_new = c("middle"), recover_old = c("middle"), @@ -48,12 +48,14 @@ time_bins.sir <- function(x, ..., middle = TRUE) { head_args = c("x"), fn_name = "time_bins" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/flow.R b/R/flow.R index ea2c4b6f509..a28a779465b 100644 --- a/R/flow.R +++ b/R/flow.R @@ -395,7 +395,7 @@ min_cut <- function( # BEGIN GENERATED ARG_HANDLE: min_cut, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(capacity = capacity, value.only = value.only), recover_new = c("capacity", "value.only"), recover_old = c("capacity", "value.only"), @@ -405,12 +405,14 @@ min_cut <- function( head_args = c("graph", "source", "target"), fn_name = "min_cut" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -549,7 +551,7 @@ vertex_connectivity <- function( # BEGIN GENERATED ARG_HANDLE: vertex_connectivity, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(checks = checks), recover_new = c("checks"), recover_old = c("checks"), @@ -559,12 +561,14 @@ vertex_connectivity <- function( head_args = c("graph", "source", "target"), fn_name = "vertex_connectivity" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -676,7 +680,7 @@ edge_connectivity <- function( # BEGIN GENERATED ARG_HANDLE: edge_connectivity, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(checks = checks), recover_new = c("checks"), recover_old = c("checks"), @@ -686,12 +690,14 @@ edge_connectivity <- function( head_args = c("graph", "source", "target"), fn_name = "edge_connectivity" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -753,7 +759,7 @@ adhesion <- function( # BEGIN GENERATED ARG_HANDLE: adhesion, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(checks = checks), recover_new = c("checks"), recover_old = c("checks"), @@ -763,12 +769,14 @@ adhesion <- function( head_args = c("graph"), fn_name = "adhesion" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -905,7 +913,7 @@ st_min_cuts <- function( # BEGIN GENERATED ARG_HANDLE: st_min_cuts, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(capacity = capacity), recover_new = c("capacity"), recover_old = c("capacity"), @@ -915,12 +923,14 @@ st_min_cuts <- function( head_args = c("graph", "source", "target"), fn_name = "st_min_cuts" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1005,7 +1015,7 @@ dominator_tree <- function( # BEGIN GENERATED ARG_HANDLE: dominator_tree, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -1015,12 +1025,14 @@ dominator_tree <- function( head_args = c("graph", "root"), fn_name = "dominator_tree" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1181,7 +1193,7 @@ max_flow <- function( # BEGIN GENERATED ARG_HANDLE: max_flow, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(capacity = capacity), recover_new = c("capacity"), recover_old = c("capacity"), @@ -1191,12 +1203,14 @@ max_flow <- function( head_args = c("graph", "source", "target"), fn_name = "max_flow" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/foreign.R b/R/foreign.R index 0510ab201c7..07b52882ee7 100644 --- a/R/foreign.R +++ b/R/foreign.R @@ -839,7 +839,7 @@ graph_from_graphdb <- function( # BEGIN GENERATED ARG_HANDLE: graph_from_graphdb, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( prefix = prefix, type = type, @@ -903,12 +903,14 @@ graph_from_graphdb <- function( head_args = c("url"), fn_name = "graph_from_graphdb" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/games.R b/R/games.R index 45a7ab82529..2ea4cac886b 100644 --- a/R/games.R +++ b/R/games.R @@ -886,7 +886,7 @@ sample_pa <- function( # BEGIN GENERATED ARG_HANDLE: sample_pa, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( out.dist = out.dist, out.seq = out.seq, @@ -944,12 +944,14 @@ sample_pa <- function( head_args = c("n", "power", "m"), fn_name = "sample_pa" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1053,7 +1055,7 @@ pa <- function( # BEGIN GENERATED ARG_HANDLE: pa, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( out.dist = out.dist, out.seq = out.seq, @@ -1111,12 +1113,14 @@ pa <- function( head_args = c("n", "power", "m"), fn_name = "pa" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1184,7 +1188,7 @@ sample_gnp <- function( # BEGIN GENERATED ARG_HANDLE: sample_gnp, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, loops = loops), recover_new = c("directed", "loops"), recover_old = c("directed", "loops"), @@ -1194,12 +1198,14 @@ sample_gnp <- function( head_args = c("n", "p"), fn_name = "sample_gnp" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1234,7 +1240,7 @@ gnp <- function( # BEGIN GENERATED ARG_HANDLE: gnp, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, loops = loops), recover_new = c("directed", "loops"), recover_old = c("directed", "loops"), @@ -1244,12 +1250,14 @@ gnp <- function( head_args = c("n", "p"), fn_name = "gnp" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1291,7 +1299,7 @@ sample_gnm <- function( # BEGIN GENERATED ARG_HANDLE: sample_gnm, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, loops = loops), recover_new = c("directed", "loops"), recover_old = c("directed", "loops"), @@ -1301,12 +1309,14 @@ sample_gnm <- function( head_args = c("n", "m"), fn_name = "sample_gnm" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1341,7 +1351,7 @@ gnm <- function( # BEGIN GENERATED ARG_HANDLE: gnm, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, loops = loops), recover_new = c("directed", "loops"), recover_old = c("directed", "loops"), @@ -1351,12 +1361,14 @@ gnm <- function( head_args = c("n", "m"), fn_name = "gnm" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1625,7 +1637,7 @@ sample_degseq <- function( # BEGIN GENERATED ARG_HANDLE: sample_degseq, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(method = method), recover_new = c("method"), recover_old = c("method"), @@ -1637,12 +1649,14 @@ sample_degseq <- function( head_args = c("out.deg", "in.deg"), fn_name = "sample_degseq" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1894,7 +1908,7 @@ sample_pa_age <- function( "sample_pa_age" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( aging.bin = aging.bin, out.dist = out.dist, @@ -1970,12 +1984,14 @@ sample_pa_age <- function( head_args = c("n", "pa.exp", "aging.exp", "m"), fn_name = "sample_pa_age" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2118,7 +2134,7 @@ pa_age <- function( "pa_age" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( aging.bin = aging.bin, out.dist = out.dist, @@ -2194,12 +2210,14 @@ pa_age <- function( head_args = c("n", "pa.exp", "aging.exp", "m"), fn_name = "pa_age" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2281,7 +2299,7 @@ sample_traits_callaway <- function( "sample_traits_callaway" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( edge.per.step = edge.per.step, type.dist = type.dist, @@ -2301,12 +2319,14 @@ sample_traits_callaway <- function( head_args = c("nodes", "types"), fn_name = "sample_traits_callaway" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2359,7 +2379,7 @@ traits_callaway <- function( "traits_callaway" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( edge.per.step = edge.per.step, type.dist = type.dist, @@ -2379,12 +2399,14 @@ traits_callaway <- function( head_args = c("nodes", "types"), fn_name = "traits_callaway" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2426,7 +2448,7 @@ sample_traits <- function( "sample_traits" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( type.dist = type.dist, pref.matrix = pref.matrix, @@ -2440,12 +2462,14 @@ sample_traits <- function( head_args = c("nodes", "types", "k"), fn_name = "sample_traits" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2494,7 +2518,7 @@ traits <- function( "traits" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( type.dist = type.dist, pref.matrix = pref.matrix, @@ -2508,12 +2532,14 @@ traits <- function( head_args = c("nodes", "types", "k"), fn_name = "traits" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2577,7 +2603,7 @@ sample_grg <- function( # BEGIN GENERATED ARG_HANDLE: sample_grg, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(torus = torus, coords = coords), recover_new = c("torus", "coords"), recover_old = c("torus", "coords"), @@ -2587,12 +2613,14 @@ sample_grg <- function( head_args = c("nodes", "radius"), fn_name = "sample_grg" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2629,7 +2657,7 @@ grg <- function( # BEGIN GENERATED ARG_HANDLE: grg, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(torus = torus, coords = coords), recover_new = c("torus", "coords"), recover_old = c("torus", "coords"), @@ -2639,12 +2667,14 @@ grg <- function( head_args = c("nodes", "radius"), fn_name = "grg" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2738,7 +2768,7 @@ sample_pref <- function( "sample_pref" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( type.dist = type.dist, fixed.sizes = fixed.sizes, @@ -2784,12 +2814,14 @@ sample_pref <- function( head_args = c("nodes", "types"), fn_name = "sample_pref" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2849,7 +2881,7 @@ pref <- function( "pref" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( type.dist = type.dist, fixed.sizes = fixed.sizes, @@ -2895,12 +2927,14 @@ pref <- function( head_args = c("nodes", "types"), fn_name = "pref" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2942,7 +2976,7 @@ sample_asym_pref <- function( "sample_asym_pref" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( type.dist.matrix = type.dist.matrix, pref.matrix = pref.matrix, @@ -2960,12 +2994,14 @@ sample_asym_pref <- function( head_args = c("nodes", "types"), fn_name = "sample_asym_pref" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3029,7 +3065,7 @@ asym_pref <- function( "asym_pref" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( type.dist.matrix = type.dist.matrix, pref.matrix = pref.matrix, @@ -3047,12 +3083,14 @@ asym_pref <- function( head_args = c("nodes", "types"), fn_name = "asym_pref" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3088,7 +3126,7 @@ connect <- function( # BEGIN GENERATED ARG_HANDLE: connect, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -3098,12 +3136,14 @@ connect <- function( head_args = c("graph", "order"), fn_name = "connect" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3176,7 +3216,7 @@ sample_smallworld <- function( # BEGIN GENERATED ARG_HANDLE: sample_smallworld, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(loops = loops, multiple = multiple), recover_new = c("loops", "multiple"), recover_old = c("loops", "multiple"), @@ -3186,12 +3226,14 @@ sample_smallworld <- function( head_args = c("dim", "size", "nei", "p"), fn_name = "sample_smallworld" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3230,7 +3272,7 @@ smallworld <- function( # BEGIN GENERATED ARG_HANDLE: smallworld, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(loops = loops, multiple = multiple), recover_new = c("loops", "multiple"), recover_old = c("loops", "multiple"), @@ -3240,12 +3282,14 @@ smallworld <- function( head_args = c("dim", "size", "nei", "p"), fn_name = "smallworld" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3306,7 +3350,7 @@ sample_last_cit <- function( # BEGIN GENERATED ARG_HANDLE: sample_last_cit, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(agebins = agebins, pref = pref, directed = directed), recover_new = c("agebins", "pref", "directed"), recover_old = c("agebins", "pref", "directed"), @@ -3316,12 +3360,14 @@ sample_last_cit <- function( head_args = c("n", "edges"), fn_name = "sample_last_cit" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3361,7 +3407,7 @@ last_cit <- function( # BEGIN GENERATED ARG_HANDLE: last_cit, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(agebins = agebins, pref = pref, directed = directed), recover_new = c("agebins", "pref", "directed"), recover_old = c("agebins", "pref", "directed"), @@ -3371,12 +3417,14 @@ last_cit <- function( head_args = c("n", "edges"), fn_name = "last_cit" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3412,7 +3460,7 @@ sample_cit_types <- function( # BEGIN GENERATED ARG_HANDLE: sample_cit_types, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(pref = pref, directed = directed, attr = attr), recover_new = c("pref", "directed", "attr"), recover_old = c("pref", "directed", "attr"), @@ -3422,12 +3470,14 @@ sample_cit_types <- function( head_args = c("n", "edges", "types"), fn_name = "sample_cit_types" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3470,7 +3520,7 @@ cit_types <- function( # BEGIN GENERATED ARG_HANDLE: cit_types, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(pref = pref, directed = directed, attr = attr), recover_new = c("pref", "directed", "attr"), recover_old = c("pref", "directed", "attr"), @@ -3480,12 +3530,14 @@ cit_types <- function( head_args = c("n", "edges", "types"), fn_name = "cit_types" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3522,7 +3574,7 @@ sample_cit_cit_types <- function( # BEGIN GENERATED ARG_HANDLE: sample_cit_cit_types, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(pref = pref, directed = directed, attr = attr), recover_new = c("pref", "directed", "attr"), recover_old = c("pref", "directed", "attr"), @@ -3532,12 +3584,14 @@ sample_cit_cit_types <- function( head_args = c("n", "edges", "types"), fn_name = "sample_cit_cit_types" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3581,7 +3635,7 @@ cit_cit_types <- function( # BEGIN GENERATED ARG_HANDLE: cit_cit_types, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(pref = pref, directed = directed, attr = attr), recover_new = c("pref", "directed", "attr"), recover_old = c("pref", "directed", "attr"), @@ -3591,12 +3645,14 @@ cit_cit_types <- function( head_args = c("n", "edges", "types"), fn_name = "cit_cit_types" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3903,7 +3959,7 @@ sample_sbm <- function( # BEGIN GENERATED ARG_HANDLE: sample_sbm, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, loops = loops), recover_new = c("directed", "loops"), recover_old = c("directed", "loops"), @@ -3913,12 +3969,14 @@ sample_sbm <- function( head_args = c("n", "pref.matrix", "block.sizes"), fn_name = "sample_sbm" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3945,7 +4003,7 @@ sbm <- function( # BEGIN GENERATED ARG_HANDLE: sbm, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, loops = loops), recover_new = c("directed", "loops"), recover_old = c("directed", "loops"), @@ -3955,12 +4013,14 @@ sbm <- function( head_args = c("n", "pref.matrix", "block.sizes"), fn_name = "sbm" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -4120,7 +4180,7 @@ sample_dot_product <- function( # BEGIN GENERATED ARG_HANDLE: sample_dot_product, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -4130,12 +4190,14 @@ sample_dot_product <- function( head_args = c("vecs"), fn_name = "sample_dot_product" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -4156,7 +4218,7 @@ dot_product <- function( # BEGIN GENERATED ARG_HANDLE: dot_product, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -4166,12 +4228,14 @@ dot_product <- function( head_args = c("vecs"), fn_name = "dot_product" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -4268,7 +4332,7 @@ sample_k_regular <- function( # BEGIN GENERATED ARG_HANDLE: sample_k_regular, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, multiple = multiple), recover_new = c("directed", "multiple"), recover_old = c("directed", "multiple"), @@ -4278,12 +4342,14 @@ sample_k_regular <- function( head_args = c("no.of.nodes", "k"), fn_name = "sample_k_regular" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -4544,7 +4610,7 @@ sample_fitness <- function( # BEGIN GENERATED ARG_HANDLE: sample_fitness, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(loops = loops, multiple = multiple), recover_new = c("loops", "multiple"), recover_old = c("loops", "multiple"), @@ -4554,12 +4620,14 @@ sample_fitness <- function( head_args = c("no.of.edges", "fitness.out", "fitness.in"), fn_name = "sample_fitness" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -4647,7 +4715,7 @@ sample_fitness_pl <- function( # BEGIN GENERATED ARG_HANDLE: sample_fitness_pl, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( loops = loops, multiple = multiple, @@ -4670,12 +4738,14 @@ sample_fitness_pl <- function( ), fn_name = "sample_fitness_pl" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -4771,7 +4841,7 @@ sample_forestfire <- function( # BEGIN GENERATED ARG_HANDLE: sample_forestfire, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(bw.factor = bw.factor, ambs = ambs, directed = directed), recover_new = c("bw.factor", "ambs", "directed"), recover_old = c("bw.factor", "ambs", "directed"), @@ -4781,12 +4851,14 @@ sample_forestfire <- function( head_args = c("nodes", "fw.prob"), fn_name = "sample_forestfire" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -4855,7 +4927,7 @@ sample_correlated_gnp <- function( # BEGIN GENERATED ARG_HANDLE: sample_correlated_gnp, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(p = p, permutation = permutation), recover_new = c("p", "permutation"), recover_old = c("p", "permutation"), @@ -4865,12 +4937,14 @@ sample_correlated_gnp <- function( head_args = c("old.graph", "corr"), fn_name = "sample_correlated_gnp" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/glet.R b/R/glet.R index 718d93f80c2..3b09a3ccbb9 100644 --- a/R/glet.R +++ b/R/glet.R @@ -145,7 +145,7 @@ graphlet_basis <- function( # BEGIN GENERATED ARG_HANDLE: graphlet_basis, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights), recover_new = c("weights"), recover_old = c("weights"), @@ -155,12 +155,14 @@ graphlet_basis <- function( head_args = c("graph"), fn_name = "graphlet_basis" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -184,7 +186,7 @@ graphlet_proj <- function( # BEGIN GENERATED ARG_HANDLE: graphlet_proj, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, niter = niter, Mu = Mu), recover_new = c("weights", "cliques", "niter", "Mu"), recover_old = c("weights", "cliques", "niter", "Mu"), @@ -194,12 +196,14 @@ graphlet_proj <- function( head_args = c("graph"), fn_name = "graphlet_proj" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -295,7 +299,7 @@ graphlets <- function( # BEGIN GENERATED ARG_HANDLE: graphlets, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, niter = niter), recover_new = c("weights", "niter"), recover_old = c("weights", "niter"), @@ -305,12 +309,14 @@ graphlets <- function( head_args = c("graph"), fn_name = "graphlets" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/hrg.R b/R/hrg.R index d01be950169..fa716431267 100644 --- a/R/hrg.R +++ b/R/hrg.R @@ -243,7 +243,7 @@ fit_hrg <- function( # BEGIN GENERATED ARG_HANDLE: fit_hrg, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(start = start, steps = steps), recover_new = c("start", "steps"), recover_old = c("start", "steps"), @@ -253,12 +253,14 @@ fit_hrg <- function( head_args = c("graph", "hrg"), fn_name = "fit_hrg" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -344,7 +346,7 @@ consensus_tree <- function( # BEGIN GENERATED ARG_HANDLE: consensus_tree, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(start = start, num.samples = num.samples), recover_new = c("start", "num.samples"), recover_old = c("start", "num.samples"), @@ -354,12 +356,14 @@ consensus_tree <- function( head_args = c("graph", "hrg"), fn_name = "consensus_tree" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -510,7 +514,7 @@ predict_edges <- function( # BEGIN GENERATED ARG_HANDLE: predict_edges, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( start = start, num.samples = num.samples, @@ -524,12 +528,14 @@ predict_edges <- function( head_args = c("graph", "hrg"), fn_name = "predict_edges" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/incidence.R b/R/incidence.R index 7ca08b1b9d7..264debf9f05 100644 --- a/R/incidence.R +++ b/R/incidence.R @@ -197,7 +197,7 @@ graph_from_biadjacency_matrix <- function( # BEGIN GENERATED ARG_HANDLE: graph_from_biadjacency_matrix, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( directed = directed, mode = mode, @@ -219,12 +219,14 @@ graph_from_biadjacency_matrix <- function( head_args = c("incidence"), fn_name = "graph_from_biadjacency_matrix" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/interface.R b/R/interface.R index bc46be018ee..a757fa91a56 100644 --- a/R/interface.R +++ b/R/interface.R @@ -358,7 +358,7 @@ neighbors <- function( # BEGIN GENERATED ARG_HANDLE: neighbors, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -368,12 +368,14 @@ neighbors <- function( head_args = c("graph", "v"), fn_name = "neighbors" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -417,7 +419,7 @@ incident <- function( # BEGIN GENERATED ARG_HANDLE: incident, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -427,12 +429,14 @@ incident <- function( head_args = c("graph", "v"), fn_name = "incident" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -496,7 +500,7 @@ ends <- function( # BEGIN GENERATED ARG_HANDLE: ends, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(names = names), recover_new = c("names"), recover_old = c("names"), @@ -506,12 +510,14 @@ ends <- function( head_args = c("graph", "es"), fn_name = "ends" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -638,7 +644,7 @@ get_edge_ids <- function( # BEGIN GENERATED ARG_HANDLE: get_edge_ids, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, error = error), recover_new = c("directed", "error"), recover_old = c("directed", "error"), @@ -648,12 +654,14 @@ get_edge_ids <- function( head_args = c("graph", "vp"), fn_name = "get_edge_ids" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -752,7 +760,7 @@ adjacent_vertices <- function( # BEGIN GENERATED ARG_HANDLE: adjacent_vertices, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -762,12 +770,14 @@ adjacent_vertices <- function( head_args = c("graph", "v"), fn_name = "adjacent_vertices" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -817,7 +827,7 @@ incident_edges <- function( # BEGIN GENERATED ARG_HANDLE: incident_edges, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -827,12 +837,14 @@ incident_edges <- function( head_args = c("graph", "v"), fn_name = "incident_edges" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/iterators.R b/R/iterators.R index 6eb1072e228..9908b0c96c2 100644 --- a/R/iterators.R +++ b/R/iterators.R @@ -88,7 +88,7 @@ identical_graphs <- function( # BEGIN GENERATED ARG_HANDLE: identical_graphs, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(attrs = attrs), recover_new = c("attrs"), recover_old = c("attrs"), @@ -98,12 +98,14 @@ identical_graphs <- function( head_args = c("g1", "g2"), fn_name = "identical_graphs" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -382,7 +384,7 @@ E <- function( # BEGIN GENERATED ARG_HANDLE: E, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(P = P, path = path, directed = directed), recover_new = c("P", "path", "directed"), recover_old = c("P", "path", "directed"), @@ -392,12 +394,14 @@ E <- function( head_args = c("graph"), fn_name = "E" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/layout.R b/R/layout.R index aa15547ea6a..a1142c89366 100644 --- a/R/layout.R +++ b/R/layout.R @@ -730,7 +730,7 @@ layout_as_bipartite <- function( # BEGIN GENERATED ARG_HANDLE: layout_as_bipartite, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(hgap = hgap, vgap = vgap, maxiter = maxiter), recover_new = c("hgap", "vgap", "maxiter"), recover_old = c("hgap", "vgap", "maxiter"), @@ -740,12 +740,14 @@ layout_as_bipartite <- function( head_args = c("graph", "types"), fn_name = "layout_as_bipartite" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -809,7 +811,7 @@ layout_as_star <- function( # BEGIN GENERATED ARG_HANDLE: layout_as_star, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(center = center, order = order), recover_new = c("center", "order"), recover_old = c("center", "order"), @@ -819,12 +821,14 @@ layout_as_star <- function( head_args = c("graph"), fn_name = "layout_as_star" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -924,7 +928,7 @@ layout_as_tree <- function( # BEGIN GENERATED ARG_HANDLE: layout_as_tree, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( root = root, circular = circular, @@ -946,12 +950,14 @@ layout_as_tree <- function( head_args = c("graph"), fn_name = "layout_as_tree" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1241,7 +1247,7 @@ layout_on_grid <- function( # BEGIN GENERATED ARG_HANDLE: layout_on_grid, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(width = width, height = height, dim = dim), recover_new = c("width", "height", "dim"), recover_old = c("width", "height", "dim"), @@ -1251,12 +1257,14 @@ layout_on_grid <- function( head_args = c("graph"), fn_name = "layout_on_grid" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1365,7 +1373,7 @@ layout_randomly <- function( # BEGIN GENERATED ARG_HANDLE: layout_randomly, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(dim = dim), recover_new = c("dim"), recover_old = c("dim"), @@ -1375,12 +1383,14 @@ layout_randomly <- function( head_args = c("graph"), fn_name = "layout_randomly" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1552,7 +1562,7 @@ layout_with_dh <- function( # BEGIN GENERATED ARG_HANDLE: layout_with_dh, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( coords = coords, maxiter = maxiter, @@ -1622,12 +1632,14 @@ layout_with_dh <- function( head_args = c("graph"), fn_name = "layout_with_dh" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1784,7 +1796,7 @@ layout_with_fr <- function( "layout_with_fr" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( coords = coords, dim = dim, @@ -1902,12 +1914,14 @@ layout_with_fr <- function( head_args = c("graph"), fn_name = "layout_with_fr" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2085,7 +2099,7 @@ layout_with_gem <- function( # BEGIN GENERATED ARG_HANDLE: layout_with_gem, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( coords = coords, maxiter = maxiter, @@ -2107,12 +2121,14 @@ layout_with_gem <- function( head_args = c("graph"), fn_name = "layout_with_gem" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2208,7 +2224,7 @@ layout_with_graphopt <- function( # BEGIN GENERATED ARG_HANDLE: layout_with_graphopt, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( start = start, niter = niter, @@ -2266,12 +2282,14 @@ layout_with_graphopt <- function( head_args = c("graph"), fn_name = "layout_with_graphopt" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2394,7 +2412,7 @@ layout_with_kk <- function( # BEGIN GENERATED ARG_HANDLE: layout_with_kk, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( coords = coords, dim = dim, @@ -2512,12 +2530,14 @@ layout_with_kk <- function( head_args = c("graph"), fn_name = "layout_with_kk" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2694,7 +2714,7 @@ layout_with_lgl <- function( # BEGIN GENERATED ARG_HANDLE: layout_with_lgl, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( maxiter = maxiter, maxdelta = maxdelta, @@ -2752,12 +2772,14 @@ layout_with_lgl <- function( head_args = c("graph"), fn_name = "layout_with_lgl" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3124,7 +3146,7 @@ layout_with_sugiyama <- function( # BEGIN GENERATED ARG_HANDLE: layout_with_sugiyama, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( layers = layers, hgap = hgap, @@ -3176,12 +3198,14 @@ layout_with_sugiyama <- function( head_args = c("graph"), fn_name = "layout_with_sugiyama" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3364,7 +3388,7 @@ merge_coords <- function( # BEGIN GENERATED ARG_HANDLE: merge_coords, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(method = method), recover_new = c("method"), recover_old = c("method"), @@ -3374,12 +3398,14 @@ merge_coords <- function( head_args = c("graphs", "layouts"), fn_name = "merge_coords" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3431,7 +3457,7 @@ norm_coords <- function( # BEGIN GENERATED ARG_HANDLE: norm_coords, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( xmin = xmin, xmax = xmax, @@ -3455,12 +3481,14 @@ norm_coords <- function( head_args = c("layout"), fn_name = "norm_coords" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3756,7 +3784,7 @@ layout_with_drl <- function( # BEGIN GENERATED ARG_HANDLE: layout_with_drl, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( use.seed = use.seed, seed = seed, @@ -3778,12 +3806,14 @@ layout_with_drl <- function( head_args = c("graph"), fn_name = "layout_with_drl" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/make.R b/R/make.R index fece9900e95..ce86a99c75a 100644 --- a/R/make.R +++ b/R/make.R @@ -1602,7 +1602,7 @@ make_empty_graph <- function( # BEGIN GENERATED ARG_HANDLE: make_empty_graph, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -1612,12 +1612,14 @@ make_empty_graph <- function( head_args = c("n"), fn_name = "make_empty_graph" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1646,7 +1648,7 @@ empty_graph <- function( # BEGIN GENERATED ARG_HANDLE: empty_graph, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -1656,12 +1658,14 @@ empty_graph <- function( head_args = c("n"), fn_name = "empty_graph" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1933,7 +1937,7 @@ make_star <- function( # BEGIN GENERATED ARG_HANDLE: make_star, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, center = center), recover_new = c("mode", "center"), recover_old = c("mode", "center"), @@ -1946,12 +1950,14 @@ make_star <- function( head_args = c("n"), fn_name = "make_star" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1982,7 +1988,7 @@ star <- function( # BEGIN GENERATED ARG_HANDLE: star, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, center = center), recover_new = c("mode", "center"), recover_old = c("mode", "center"), @@ -1995,12 +2001,14 @@ star <- function( head_args = c("n"), fn_name = "star" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2032,7 +2040,7 @@ make_full_graph <- function( # BEGIN GENERATED ARG_HANDLE: make_full_graph, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, loops = loops), recover_new = c("directed", "loops"), recover_old = c("directed", "loops"), @@ -2042,12 +2050,14 @@ make_full_graph <- function( head_args = c("n"), fn_name = "make_full_graph" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2075,7 +2085,7 @@ full_graph <- function( # BEGIN GENERATED ARG_HANDLE: full_graph, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, loops = loops), recover_new = c("directed", "loops"), recover_old = c("directed", "loops"), @@ -2085,12 +2095,14 @@ full_graph <- function( head_args = c("n"), fn_name = "full_graph" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2236,7 +2248,7 @@ make_ring <- function( # BEGIN GENERATED ARG_HANDLE: make_ring, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, mutual = mutual, circular = circular), recover_new = c("directed", "mutual", "circular"), recover_old = c("directed", "mutual", "circular"), @@ -2246,12 +2258,14 @@ make_ring <- function( head_args = c("n"), fn_name = "make_ring" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2282,7 +2296,7 @@ ring <- function( # BEGIN GENERATED ARG_HANDLE: ring, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, mutual = mutual, circular = circular), recover_new = c("directed", "mutual", "circular"), recover_old = c("directed", "mutual", "circular"), @@ -2292,12 +2306,14 @@ ring <- function( head_args = c("n"), fn_name = "ring" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2413,7 +2429,7 @@ make_tree <- function( # BEGIN GENERATED ARG_HANDLE: make_tree, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -2423,12 +2439,14 @@ make_tree <- function( head_args = c("n", "children"), fn_name = "make_tree" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2483,7 +2501,7 @@ sample_tree <- function( # BEGIN GENERATED ARG_HANDLE: sample_tree, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, method = method), recover_new = c("directed", "method"), recover_old = c("directed", "method"), @@ -2493,12 +2511,14 @@ sample_tree <- function( head_args = c("n"), fn_name = "sample_tree" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2638,7 +2658,7 @@ make_chordal_ring <- function( # BEGIN GENERATED ARG_HANDLE: make_chordal_ring, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -2648,12 +2668,14 @@ make_chordal_ring <- function( head_args = c("n", "w"), fn_name = "make_chordal_ring" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2681,7 +2703,7 @@ chordal_ring <- function( # BEGIN GENERATED ARG_HANDLE: chordal_ring, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -2691,12 +2713,14 @@ chordal_ring <- function( head_args = c("n", "w"), fn_name = "chordal_ring" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2739,7 +2763,7 @@ make_circulant <- function( # BEGIN GENERATED ARG_HANDLE: make_circulant, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -2749,12 +2773,14 @@ make_circulant <- function( head_args = c("n", "shifts"), fn_name = "make_circulant" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2777,7 +2803,7 @@ circulant <- function( # BEGIN GENERATED ARG_HANDLE: circulant, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -2787,12 +2813,14 @@ circulant <- function( head_args = c("n", "shifts"), fn_name = "circulant" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2990,7 +3018,7 @@ make_full_bipartite_graph <- function( # BEGIN GENERATED ARG_HANDLE: make_full_bipartite_graph, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, mode = mode), recover_new = c("directed", "mode"), recover_old = c("directed", "mode"), @@ -3000,12 +3028,14 @@ make_full_bipartite_graph <- function( head_args = c("n1", "n2"), fn_name = "make_full_bipartite_graph" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3041,7 +3071,7 @@ full_bipartite_graph <- function( # BEGIN GENERATED ARG_HANDLE: full_bipartite_graph, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, mode = mode), recover_new = c("directed", "mode"), recover_old = c("directed", "mode"), @@ -3051,12 +3081,14 @@ full_bipartite_graph <- function( head_args = c("n1", "n2"), fn_name = "full_bipartite_graph" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3122,7 +3154,7 @@ make_bipartite_graph <- function( # BEGIN GENERATED ARG_HANDLE: make_bipartite_graph, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -3132,12 +3164,14 @@ make_bipartite_graph <- function( head_args = c("types", "edges"), fn_name = "make_bipartite_graph" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3187,7 +3221,7 @@ bipartite_graph <- function( # BEGIN GENERATED ARG_HANDLE: bipartite_graph, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -3197,12 +3231,14 @@ bipartite_graph <- function( head_args = c("types", "edges"), fn_name = "bipartite_graph" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3253,7 +3289,7 @@ make_full_multipartite <- function( # BEGIN GENERATED ARG_HANDLE: make_full_multipartite, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, mode = mode), recover_new = c("directed", "mode"), recover_old = c("directed", "mode"), @@ -3263,12 +3299,14 @@ make_full_multipartite <- function( head_args = c("n"), fn_name = "make_full_multipartite" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3304,7 +3342,7 @@ full_multipartite <- function( # BEGIN GENERATED ARG_HANDLE: full_multipartite, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed, mode = mode), recover_new = c("directed", "mode"), recover_old = c("directed", "mode"), @@ -3314,12 +3352,14 @@ full_multipartite <- function( head_args = c("n"), fn_name = "full_multipartite" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3410,7 +3450,7 @@ make_full_citation_graph <- function( # BEGIN GENERATED ARG_HANDLE: make_full_citation_graph, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -3420,12 +3460,14 @@ make_full_citation_graph <- function( head_args = c("n"), fn_name = "make_full_citation_graph" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3450,7 +3492,7 @@ full_citation_graph <- function( # BEGIN GENERATED ARG_HANDLE: full_citation_graph, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -3460,12 +3502,14 @@ full_citation_graph <- function( head_args = c("n"), fn_name = "full_citation_graph" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3637,7 +3681,7 @@ realize_degseq <- function( # BEGIN GENERATED ARG_HANDLE: realize_degseq, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(allowed.edge.types = allowed.edge.types, method = method), recover_new = c("allowed.edge.types", "method"), recover_old = c("allowed.edge.types", "method"), @@ -3650,12 +3694,14 @@ realize_degseq <- function( head_args = c("out.deg", "in.deg"), fn_name = "realize_degseq" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/migrate-args.R b/R/migrate-args.R index dd585490caa..4d2e48774f2 100644 --- a/R/migrate-args.R +++ b/R/migrate-args.R @@ -4,6 +4,13 @@ # call this. Kept a plain function (not an inline closure) so it is easy to step # through in a debugger. # +# `dots` is `rlang::pairlist2(...)`, not `list(...)`: a call may leave an +# argument slot empty -- a trailing comma (`f(x, mode = "out", )`) or a skipped +# positional, which is what magrittr writes for `x %>% f(., , directed = FALSE)` +# -- and `list(...)` forces such a slot, erroring with "argument is missing, +# with no default" (#2646). `pairlist2()` keeps the empty slots as the missing +# argument instead, so they arrive here unforced and are simply skipped below. +# # Pure: it inspects `dots` against the supplied maps and returns the recovered # values plus the deprecation message parts, or NULL when there is nothing to # recover. It never touches an environment and never emits the deprecation @@ -24,10 +31,6 @@ migrate_recover_args <- function( fn_name, call = rlang::caller_env() ) { - if (length(dots) == 0L) { - return(NULL) - } - dot_names <- rlang::names2(dots) values <- list() rebound_old <- character() @@ -35,6 +38,16 @@ migrate_recover_args <- function( pos <- 0L for (k in seq_along(dots)) { nm <- dot_names[[k]] + if (rlang::is_missing(dots[[k]])) { + # An empty slot is not an argument to recover, but it still consumed a + # formal under the old signature -- so it keeps its position, and the + # positionals after it shift along: `f(g, , 5)` recovers 5 into the + # *second* recoverable argument, not the first. + if (!nzchar(nm)) { + pos <- pos + 1L + } + next + } if (nzchar(nm)) { # Named (possibly abbreviated): partial-match the recoverable names. j <- charmatch(nm, match_names) @@ -87,6 +100,13 @@ migrate_recover_args <- function( rebound_new <- c(rebound_new, new_name) } + if (length(rebound_new) == 0L) { + # No dots at all, or nothing but empty slots: the formals keep their + # defaults, exactly as under the old signature. Nothing to recover, and no + # deprecation to emit. + return(NULL) + } + detected <- paste0( fn_name, "(", diff --git a/R/migration-fixture.R b/R/migration-fixture.R index 9303f3c49f0..fd41118b2c6 100644 --- a/R/migration-fixture.R +++ b/R/migration-fixture.R @@ -20,7 +20,7 @@ migration_fixture <- function( # BEGIN GENERATED ARG_HANDLE: migration_fixture, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, type = type, directed = directed), recover_new = c("weights", "type", "directed"), recover_old = c("weight", "kind", "directed"), @@ -30,12 +30,14 @@ migration_fixture <- function( head_args = c("graph", "n"), fn_name = "migration_fixture" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -70,7 +72,7 @@ migration_fixture_prefix <- function( "migration_fixture_prefix" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(dim = dim, permutation = permutation), recover_new = c("dim", "permutation"), recover_old = c("dim", "permutation"), @@ -80,12 +82,14 @@ migration_fixture_prefix <- function( head_args = c("dimvector", "p"), fn_name = "migration_fixture_prefix" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/motifs.R b/R/motifs.R index 4255817e694..dbe2384837c 100644 --- a/R/motifs.R +++ b/R/motifs.R @@ -182,7 +182,7 @@ motifs <- function( # BEGIN GENERATED ARG_HANDLE: motifs, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(cut.prob = cut.prob, callback = callback), recover_new = c("cut.prob", "callback"), recover_old = c("cut.prob", "callback"), @@ -192,12 +192,14 @@ motifs <- function( head_args = c("graph", "size"), fn_name = "motifs" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -262,7 +264,7 @@ count_motifs <- function( # BEGIN GENERATED ARG_HANDLE: count_motifs, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(cut.prob = cut.prob), recover_new = c("cut.prob"), recover_old = c("cut.prob"), @@ -272,12 +274,14 @@ count_motifs <- function( head_args = c("graph", "size"), fn_name = "count_motifs" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -343,7 +347,7 @@ sample_motifs <- function( "sample_motifs" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( cut.prob = cut.prob, sample.size = sample.size, @@ -357,12 +361,14 @@ sample_motifs <- function( head_args = c("graph", "size"), fn_name = "sample_motifs" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/operators.R b/R/operators.R index 439d9306b6c..2bbc9309f05 100644 --- a/R/operators.R +++ b/R/operators.R @@ -909,7 +909,7 @@ complementer <- function( # BEGIN GENERATED ARG_HANDLE: complementer, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(loops = loops), recover_new = c("loops"), recover_old = c("loops"), @@ -919,12 +919,14 @@ complementer <- function( head_args = c("graph"), fn_name = "complementer" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1016,7 +1018,7 @@ compose <- function( # BEGIN GENERATED ARG_HANDLE: compose, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( byname = byname, graph.attr.comb = graph.attr.comb, @@ -1056,12 +1058,14 @@ compose <- function( head_args = c("g1", "g2"), fn_name = "compose" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/par.R b/R/par.R index 36bfd03fb14..e0d4b198d94 100644 --- a/R/par.R +++ b/R/par.R @@ -305,7 +305,7 @@ igraph_opt <- function( # BEGIN GENERATED ARG_HANDLE: igraph_opt, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(default = default), recover_new = c("default"), recover_old = c("default"), @@ -315,12 +315,14 @@ igraph_opt <- function( head_args = c("x"), fn_name = "igraph_opt" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/paths.R b/R/paths.R index 24adaac043c..34c4b5be128 100644 --- a/R/paths.R +++ b/R/paths.R @@ -119,7 +119,7 @@ all_simple_paths <- function( # BEGIN GENERATED ARG_HANDLE: all_simple_paths, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, cutoff = cutoff), recover_new = c("mode", "cutoff"), recover_old = c("mode", "cutoff"), @@ -129,12 +129,14 @@ all_simple_paths <- function( head_args = c("graph", "from", "to"), fn_name = "all_simple_paths" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -447,7 +449,7 @@ distance_table <- function( # BEGIN GENERATED ARG_HANDLE: distance_table, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -457,12 +459,14 @@ distance_table <- function( head_args = c("graph"), fn_name = "distance_table" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/plot.common.R b/R/plot.common.R index e578de48011..0956ba850f1 100644 --- a/R/plot.common.R +++ b/R/plot.common.R @@ -739,7 +739,7 @@ curve_multiple <- function( # BEGIN GENERATED ARG_HANDLE: curve_multiple, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(start = start), recover_new = c("start"), recover_old = c("start"), @@ -749,12 +749,14 @@ curve_multiple <- function( head_args = c("graph"), fn_name = "curve_multiple" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/plot.shapes.R b/R/plot.shapes.R index 927455849d3..f46875dc2d4 100644 --- a/R/plot.shapes.R +++ b/R/plot.shapes.R @@ -383,7 +383,7 @@ add_shape <- function( # BEGIN GENERATED ARG_HANDLE: add_shape, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(clip = clip, plot = plot, parameters = parameters), recover_new = c("clip", "plot", "parameters"), recover_old = c("clip", "plot", "parameters"), @@ -393,12 +393,14 @@ add_shape <- function( head_args = c("shape"), fn_name = "add_shape" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/random_walk.R b/R/random_walk.R index 4d610ccecaa..12dd7eefb89 100644 --- a/R/random_walk.R +++ b/R/random_walk.R @@ -60,7 +60,7 @@ random_walk <- function( # BEGIN GENERATED ARG_HANDLE: random_walk, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, mode = mode, stuck = stuck), recover_new = c("weights", "mode", "stuck"), recover_old = c("weights", "mode", "stuck"), @@ -74,12 +74,14 @@ random_walk <- function( head_args = c("graph", "start", "steps"), fn_name = "random_walk" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -113,7 +115,7 @@ random_edge_walk <- function( # BEGIN GENERATED ARG_HANDLE: random_edge_walk, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, mode = mode, stuck = stuck), recover_new = c("weights", "mode", "stuck"), recover_old = c("weights", "mode", "stuck"), @@ -127,12 +129,14 @@ random_edge_walk <- function( head_args = c("graph", "start", "steps"), fn_name = "random_edge_walk" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/rewire.R b/R/rewire.R index 3e612a8b2f8..dc8968a0048 100644 --- a/R/rewire.R +++ b/R/rewire.R @@ -139,7 +139,7 @@ each_edge <- function( # BEGIN GENERATED ARG_HANDLE: each_edge, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(loops = loops, multiple = multiple, mode = mode), recover_new = c("loops", "multiple", "mode"), recover_old = c("loops", "multiple", "mode"), @@ -153,12 +153,14 @@ each_edge <- function( head_args = c("prob"), fn_name = "each_edge" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/similarity.R b/R/similarity.R index 82a01219e3f..75ad82ad3eb 100644 --- a/R/similarity.R +++ b/R/similarity.R @@ -71,7 +71,7 @@ similarity <- function( # BEGIN GENERATED ARG_HANDLE: similarity, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, loops = loops, method = method), recover_new = c("mode", "loops", "method"), recover_old = c("mode", "loops", "method"), @@ -85,12 +85,14 @@ similarity <- function( head_args = c("graph", "vids"), fn_name = "similarity" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/sir.R b/R/sir.R index 34d3c8d9497..de3ea44f086 100644 --- a/R/sir.R +++ b/R/sir.R @@ -119,7 +119,7 @@ sir <- function( # BEGIN GENERATED ARG_HANDLE: sir, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(no.sim = no.sim), recover_new = c("no.sim"), recover_old = c("no.sim"), @@ -129,12 +129,14 @@ sir <- function( head_args = c("graph", "beta", "gamma"), fn_name = "sir" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/stochastic_matrix.R b/R/stochastic_matrix.R index e91b98fc804..b9459bbf3e3 100644 --- a/R/stochastic_matrix.R +++ b/R/stochastic_matrix.R @@ -85,7 +85,7 @@ stochastic_matrix <- function( # BEGIN GENERATED ARG_HANDLE: stochastic_matrix, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(column.wise = column.wise, sparse = sparse), recover_new = c("column.wise", "sparse"), recover_old = c("column.wise", "sparse"), @@ -95,12 +95,14 @@ stochastic_matrix <- function( head_args = c("graph"), fn_name = "stochastic_matrix" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/structural-properties.R b/R/structural-properties.R index 6c7053036ea..d286697f0e9 100644 --- a/R/structural-properties.R +++ b/R/structural-properties.R @@ -761,7 +761,7 @@ diameter <- function( # BEGIN GENERATED ARG_HANDLE: diameter, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( directed = directed, unconnected = unconnected, @@ -775,12 +775,14 @@ diameter <- function( head_args = c("graph"), fn_name = "diameter" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -818,7 +820,7 @@ get_diameter <- function( # BEGIN GENERATED ARG_HANDLE: get_diameter, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( directed = directed, unconnected = unconnected, @@ -832,12 +834,14 @@ get_diameter <- function( head_args = c("graph"), fn_name = "get_diameter" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -882,7 +886,7 @@ farthest_vertices <- function( # BEGIN GENERATED ARG_HANDLE: farthest_vertices, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( directed = directed, unconnected = unconnected, @@ -896,12 +900,14 @@ farthest_vertices <- function( head_args = c("graph"), fn_name = "farthest_vertices" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -947,7 +953,7 @@ mean_distance <- function( # BEGIN GENERATED ARG_HANDLE: mean_distance, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( weights = weights, directed = directed, @@ -967,12 +973,14 @@ mean_distance <- function( head_args = c("graph"), fn_name = "mean_distance" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1040,7 +1048,7 @@ degree <- function( # BEGIN GENERATED ARG_HANDLE: degree, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, loops = loops, normalized = normalized), recover_new = c("mode", "loops", "normalized"), recover_old = c("mode", "loops", "normalized"), @@ -1054,12 +1062,14 @@ degree <- function( head_args = c("graph", "v"), fn_name = "degree" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1118,7 +1128,7 @@ mean_degree <- function( # BEGIN GENERATED ARG_HANDLE: mean_degree, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(loops = loops), recover_new = c("loops"), recover_old = c("loops"), @@ -1128,12 +1138,14 @@ mean_degree <- function( head_args = c("graph"), fn_name = "mean_degree" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1385,7 +1397,7 @@ distances <- function( # BEGIN GENERATED ARG_HANDLE: distances, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, weights = weights, algorithm = algorithm), recover_new = c("mode", "weights", "algorithm"), recover_old = c("mode", "weights", "algorithm"), @@ -1399,12 +1411,14 @@ distances <- function( head_args = c("graph", "v", "to"), fn_name = "distances" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1512,7 +1526,7 @@ shortest_paths <- function( # BEGIN GENERATED ARG_HANDLE: shortest_paths, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( mode = mode, weights = weights, @@ -1564,12 +1578,14 @@ shortest_paths <- function( head_args = c("graph", "from", "to"), fn_name = "shortest_paths" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1686,7 +1702,7 @@ all_shortest_paths <- function( # BEGIN GENERATED ARG_HANDLE: all_shortest_paths, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, weights = weights), recover_new = c("mode", "weights"), recover_old = c("mode", "weights"), @@ -1696,12 +1712,14 @@ all_shortest_paths <- function( head_args = c("graph", "from", "to"), fn_name = "all_shortest_paths" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1837,7 +1855,7 @@ subcomponent <- function( # BEGIN GENERATED ARG_HANDLE: subcomponent, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -1847,12 +1865,14 @@ subcomponent <- function( head_args = c("graph", "v"), fn_name = "subcomponent" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1933,7 +1953,7 @@ induced_subgraph <- function( # BEGIN GENERATED ARG_HANDLE: induced_subgraph, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(impl = impl), recover_new = c("impl"), recover_old = c("impl"), @@ -1945,12 +1965,14 @@ induced_subgraph <- function( head_args = c("graph", "vids"), fn_name = "induced_subgraph" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1984,7 +2006,7 @@ subgraph_from_edges <- function( # BEGIN GENERATED ARG_HANDLE: subgraph_from_edges, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(delete.vertices = delete.vertices), recover_new = c("delete.vertices"), recover_old = c("delete.vertices"), @@ -1994,12 +2016,14 @@ subgraph_from_edges <- function( head_args = c("graph", "eids"), fn_name = "subgraph_from_edges" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2180,7 +2204,7 @@ transitivity <- function( # BEGIN GENERATED ARG_HANDLE: transitivity, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(vids = vids, weights = weights, isolates = isolates), recover_new = c("vids", "weights", "isolates"), recover_old = c("vids", "weights", "isolates"), @@ -2190,12 +2214,14 @@ transitivity <- function( head_args = c("graph", "type"), fn_name = "transitivity" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2355,7 +2381,7 @@ constraint <- function( # BEGIN GENERATED ARG_HANDLE: constraint, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights), recover_new = c("weights"), recover_old = c("weights"), @@ -2365,12 +2391,14 @@ constraint <- function( head_args = c("graph", "nodes"), fn_name = "constraint" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2441,7 +2469,7 @@ reciprocity <- function( # BEGIN GENERATED ARG_HANDLE: reciprocity, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(ignore.loops = ignore.loops, mode = mode), recover_new = c("ignore.loops", "mode"), recover_old = c("ignore.loops", "mode"), @@ -2451,12 +2479,14 @@ reciprocity <- function( head_args = c("graph"), fn_name = "reciprocity" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2514,7 +2544,7 @@ edge_density <- function( # BEGIN GENERATED ARG_HANDLE: edge_density, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(loops = loops), recover_new = c("loops"), recover_old = c("loops"), @@ -2524,12 +2554,14 @@ edge_density <- function( head_args = c("graph"), fn_name = "edge_density" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2553,7 +2585,7 @@ ego_size <- function( # BEGIN GENERATED ARG_HANDLE: ego_size, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, mindist = mindist), recover_new = c("mode", "mindist"), recover_old = c("mode", "mindist"), @@ -2563,12 +2595,14 @@ ego_size <- function( head_args = c("graph", "order", "nodes"), fn_name = "ego_size" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2695,7 +2729,7 @@ ego <- function( # BEGIN GENERATED ARG_HANDLE: ego, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, mindist = mindist), recover_new = c("mode", "mindist"), recover_old = c("mode", "mindist"), @@ -2705,12 +2739,14 @@ ego <- function( head_args = c("graph", "order", "nodes"), fn_name = "ego" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2757,7 +2793,7 @@ make_ego_graph <- function( # BEGIN GENERATED ARG_HANDLE: make_ego_graph, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, mindist = mindist), recover_new = c("mode", "mindist"), recover_old = c("mode", "mindist"), @@ -2767,12 +2803,14 @@ make_ego_graph <- function( head_args = c("graph", "order", "nodes"), fn_name = "make_ego_graph" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2844,7 +2882,7 @@ coreness <- function( # BEGIN GENERATED ARG_HANDLE: coreness, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -2854,12 +2892,14 @@ coreness <- function( head_args = c("graph"), fn_name = "coreness" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2914,7 +2954,7 @@ topo_sort <- function( # BEGIN GENERATED ARG_HANDLE: topo_sort, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -2924,12 +2964,14 @@ topo_sort <- function( head_args = c("graph"), fn_name = "topo_sort" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -2989,7 +3031,7 @@ feedback_arc_set <- function( # BEGIN GENERATED ARG_HANDLE: feedback_arc_set, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, algo = algo), recover_new = c("weights", "algo"), recover_old = c("weights", "algo"), @@ -2999,12 +3041,14 @@ feedback_arc_set <- function( head_args = c("graph"), fn_name = "feedback_arc_set" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3053,7 +3097,7 @@ feedback_vertex_set <- function( # BEGIN GENERATED ARG_HANDLE: feedback_vertex_set, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, algo = algo), recover_new = c("weights", "algo"), recover_old = c("weights", "algo"), @@ -3063,12 +3107,14 @@ feedback_vertex_set <- function( head_args = c("graph"), fn_name = "feedback_vertex_set" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3135,7 +3181,7 @@ girth <- function( # BEGIN GENERATED ARG_HANDLE: girth, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(circle = circle), recover_new = c("circle"), recover_old = c("circle"), @@ -3145,12 +3191,14 @@ girth <- function( head_args = c("graph"), fn_name = "girth" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3895,7 +3943,7 @@ components <- function( # BEGIN GENERATED ARG_HANDLE: components, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -3905,12 +3953,14 @@ components <- function( head_args = c("graph"), fn_name = "components" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3943,7 +3993,7 @@ is_connected <- function( # BEGIN GENERATED ARG_HANDLE: is_connected, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -3953,12 +4003,14 @@ is_connected <- function( head_args = c("graph"), fn_name = "is_connected" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -3979,7 +4031,7 @@ count_components <- function( # BEGIN GENERATED ARG_HANDLE: count_components, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -3989,12 +4041,14 @@ count_components <- function( head_args = c("graph"), fn_name = "count_components" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -4058,7 +4112,7 @@ count_reachable <- function( # BEGIN GENERATED ARG_HANDLE: count_reachable, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode"), recover_old = c("mode"), @@ -4068,12 +4122,14 @@ count_reachable <- function( head_args = c("graph"), fn_name = "count_reachable" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -4132,7 +4188,7 @@ unfold_tree <- function( # BEGIN GENERATED ARG_HANDLE: unfold_tree, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode), recover_new = c("mode", "roots"), recover_old = c("mode", "roots"), @@ -4142,12 +4198,14 @@ unfold_tree <- function( head_args = c("graph"), fn_name = "unfold_tree" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -4424,7 +4482,7 @@ max_bipartite_match <- function( # BEGIN GENERATED ARG_HANDLE: max_bipartite_match, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(weights = weights, eps = eps), recover_new = c("weights", "eps"), recover_old = c("weights", "eps"), @@ -4434,12 +4492,14 @@ max_bipartite_match <- function( head_args = c("graph", "types"), fn_name = "max_bipartite_match" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -4504,7 +4564,7 @@ which_mutual <- function( # BEGIN GENERATED ARG_HANDLE: which_mutual, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(loops = loops), recover_new = c("loops"), recover_old = c("loops"), @@ -4514,12 +4574,14 @@ which_mutual <- function( head_args = c("graph", "eids"), fn_name = "which_mutual" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -4621,7 +4683,7 @@ knn <- function( # BEGIN GENERATED ARG_HANDLE: knn, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( mode = mode, neighbor.degree.mode = neighbor.degree.mode, @@ -4639,12 +4701,14 @@ knn <- function( head_args = c("graph", "vids"), fn_name = "knn" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/tkplot.R b/R/tkplot.R index 6bffb3c2606..5b7ebd28b2f 100644 --- a/R/tkplot.R +++ b/R/tkplot.R @@ -537,7 +537,7 @@ tk_close <- function( # BEGIN GENERATED ARG_HANDLE: tk_close, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(window.close = window.close), recover_new = c("window.close"), recover_old = c("window.close"), @@ -547,12 +547,14 @@ tk_close <- function( head_args = c("tkp.id"), fn_name = "tk_close" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -593,7 +595,7 @@ tk_fit <- function( # BEGIN GENERATED ARG_HANDLE: tk_fit, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(width = width, height = height), recover_new = c("width", "height"), recover_old = c("width", "height"), @@ -603,12 +605,14 @@ tk_fit <- function( head_args = c("tkp.id"), fn_name = "tk_fit" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -711,7 +715,7 @@ tk_coords <- function( # BEGIN GENERATED ARG_HANDLE: tk_coords, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(norm = norm), recover_new = c("norm"), recover_old = c("norm"), @@ -721,12 +725,14 @@ tk_coords <- function( head_args = c("tkp.id"), fn_name = "tk_coords" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -768,7 +774,7 @@ tk_rotate <- function( # BEGIN GENERATED ARG_HANDLE: tk_rotate, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(degree = degree, rad = rad), recover_new = c("degree", "rad"), recover_old = c("degree", "rad"), @@ -778,12 +784,14 @@ tk_rotate <- function( head_args = c("tkp.id"), fn_name = "tk_rotate" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/topology.R b/R/topology.R index eddd7069aa4..0fbf4d4218e 100644 --- a/R/topology.R +++ b/R/topology.R @@ -203,7 +203,7 @@ graph.subisomorphic.lad <- function( "graph.subisomorphic.lad" ) .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( domains = domains, induced = induced, @@ -225,12 +225,14 @@ graph.subisomorphic.lad <- function( head_args = c("pattern", "target"), fn_name = "graph.subisomorphic.lad" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -436,7 +438,7 @@ graph.isomorphic.bliss <- function( # BEGIN GENERATED ARG_HANDLE: graph.isomorphic.bliss, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(colors1 = colors1, colors2 = colors2, sh = sh), recover_new = c("colors1", "colors2", "sh"), recover_old = c("colors1", "colors2", "sh"), @@ -450,12 +452,14 @@ graph.isomorphic.bliss <- function( head_args = c("graph1", "graph2"), fn_name = "graph.isomorphic.bliss" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -481,7 +485,7 @@ graph.isomorphic.vf2 <- function( # BEGIN GENERATED ARG_HANDLE: graph.isomorphic.vf2, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( vertex.color1 = vertex.color1, vertex.color2 = vertex.color2, @@ -521,12 +525,14 @@ graph.isomorphic.vf2 <- function( head_args = c("graph1", "graph2"), fn_name = "graph.isomorphic.vf2" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -561,7 +567,7 @@ graph.subisomorphic.vf2 <- function( # BEGIN GENERATED ARG_HANDLE: graph.subisomorphic.vf2, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( vertex.color1 = vertex.color1, vertex.color2 = vertex.color2, @@ -601,12 +607,14 @@ graph.subisomorphic.vf2 <- function( head_args = c("graph1", "graph2"), fn_name = "graph.subisomorphic.vf2" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -812,7 +820,7 @@ graph.count.isomorphisms.vf2 <- function( # BEGIN GENERATED ARG_HANDLE: graph.count.isomorphisms.vf2, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( vertex.color1 = vertex.color1, vertex.color2 = vertex.color2, @@ -852,12 +860,14 @@ graph.count.isomorphisms.vf2 <- function( head_args = c("graph1", "graph2"), fn_name = "graph.count.isomorphisms.vf2" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -972,7 +982,7 @@ graph.count.subisomorphisms.vf2 <- function( # BEGIN GENERATED ARG_HANDLE: graph.count.subisomorphisms.vf2, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list( vertex.color1 = vertex.color1, vertex.color2 = vertex.color2, @@ -1012,12 +1022,14 @@ graph.count.subisomorphisms.vf2 <- function( head_args = c("graph1", "graph2"), fn_name = "graph.count.subisomorphisms.vf2" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1322,7 +1334,7 @@ graph_from_isomorphism_class <- function( # BEGIN GENERATED ARG_HANDLE: graph_from_isomorphism_class, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(directed = directed), recover_new = c("directed"), recover_old = c("directed"), @@ -1332,12 +1344,14 @@ graph_from_isomorphism_class <- function( head_args = c("size", "number"), fn_name = "graph_from_isomorphism_class" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1466,7 +1480,7 @@ canonical_permutation <- function( # BEGIN GENERATED ARG_HANDLE: canonical_permutation, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(sh = sh), recover_new = c("sh"), recover_old = c("sh"), @@ -1476,12 +1490,14 @@ canonical_permutation <- function( head_args = c("graph", "colors"), fn_name = "canonical_permutation" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1639,7 +1655,7 @@ count_automorphisms <- function( # BEGIN GENERATED ARG_HANDLE: count_automorphisms, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(sh = sh), recover_new = c("sh"), recover_old = c("sh"), @@ -1649,12 +1665,14 @@ count_automorphisms <- function( head_args = c("graph", "colors"), fn_name = "count_automorphisms" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -1748,7 +1766,7 @@ automorphism_group <- function( # BEGIN GENERATED ARG_HANDLE: automorphism_group, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(sh = sh, details = details), recover_new = c("sh", "details"), recover_old = c("sh", "details"), @@ -1761,12 +1779,14 @@ automorphism_group <- function( head_args = c("graph", "colors"), fn_name = "automorphism_group" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/R/trees.R b/R/trees.R index e97db49d324..6266b3644ca 100644 --- a/R/trees.R +++ b/R/trees.R @@ -50,7 +50,7 @@ is_tree <- function( # BEGIN GENERATED ARG_HANDLE: is_tree, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, details = details), recover_new = c("mode", "details"), recover_old = c("mode", "details"), @@ -60,12 +60,14 @@ is_tree <- function( head_args = c("graph"), fn_name = "is_tree" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -133,7 +135,7 @@ is_forest <- function( # BEGIN GENERATED ARG_HANDLE: is_forest, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(mode = mode, details = details), recover_new = c("mode", "details"), recover_old = c("mode", "details"), @@ -143,12 +145,14 @@ is_forest <- function( head_args = c("graph"), fn_name = "is_forest" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE @@ -224,7 +228,7 @@ sample_spanning_tree <- function( # BEGIN GENERATED ARG_HANDLE: sample_spanning_tree, do not edit, see tools/generate-migrations.R if (...length() > 0L) { .arg_handle <- migrate_recover_args( - list(...), + rlang::pairlist2(...), current = list(vid = vid), recover_new = c("vid"), recover_old = c("vid"), @@ -234,12 +238,14 @@ sample_spanning_tree <- function( head_args = c("graph"), fn_name = "sample_spanning_tree" ) - list2env(.arg_handle$values, environment()) - lifecycle::deprecate_soft( - "3.0.0", - what = I(.arg_handle$what), - details = .arg_handle$details - ) + if (!is.null(.arg_handle)) { + list2env(.arg_handle$values, environment()) + lifecycle::deprecate_soft( + "3.0.0", + what = I(.arg_handle$what), + details = .arg_handle$details + ) + } } # END GENERATED ARG_HANDLE diff --git a/tests/testthat/helper-test-functions.R b/tests/testthat/helper-test-functions.R index 94eae68ab9d..778d570ce01 100644 --- a/tests/testthat/helper-test-functions.R +++ b/tests/testthat/helper-test-functions.R @@ -157,7 +157,9 @@ graphlets.project.old <- function(graph, cliques, iter, Mu = NULL) { # ---- test-migration-fixture.R ----------------------------------------------- -# Config equivalent to the fixture, for exercising the helper directly. +# Config equivalent to the fixture, for exercising the helper directly. `dots` +# is what the generated block hands over -- `rlang::pairlist2(...)` -- so a test +# can pass `rlang::pairlist2(, "in")` to exercise an empty argument slot. fixture_args <- function( dots, current = list(weights = NULL, type = "out", directed = FALSE) diff --git a/tests/testthat/test-migration-fixture.R b/tests/testthat/test-migration-fixture.R index f5debcb118f..d61b7142cf8 100644 --- a/tests/testthat/test-migration-fixture.R +++ b/tests/testthat/test-migration-fixture.R @@ -99,6 +99,80 @@ test_that("recovery emits a single deprecation warning, not one per slot", { expect_length(warnings, 1L) }) +# ---- empty argument slots (#2646) ------------------------------------------- + +# A call may leave a slot empty: a trailing comma, or a skipped positional, +# which is what magrittr writes for `x %>% f(., , directed = TRUE)`. Those used +# to match a formal by position and leave it missing; now they land in `...`. + +test_that("a trailing comma is not an argument to recover", { + rlang::local_options(lifecycle_verbosity = "warning") + expect_no_warning(res <- migration_fixture("g", 5, )) + expect_equal( + res, + list(graph = "g", n = 5, weights = NULL, type = "out", directed = FALSE) + ) +}) + +test_that("a trailing comma after new-API arguments is ignored", { + rlang::local_options(lifecycle_verbosity = "warning") + expect_no_warning(res <- migration_fixture("g", 5, type = "in", )) + expect_equal(res$type, "in") +}) + +test_that("an empty slot still consumes its position during recovery", { + # Old signature f(graph, n, weight, kind, directed): the empty slot took + # `weight`, so "in"/TRUE must land on `type`/`directed`, not `weights`/`type`. + rlang::local_options(lifecycle_verbosity = "warning") + lifecycle::expect_deprecated( + res <- migration_fixture("g", 5, , "in", TRUE) + ) + expect_equal( + res, + list(graph = "g", n = 5, weights = NULL, type = "in", directed = TRUE) + ) +}) + +test_that("several empty slots each consume a position", { + rlang::local_options(lifecycle_verbosity = "warning") + lifecycle::expect_deprecated( + res <- migration_fixture("g", 5, , , TRUE) + ) + expect_equal(res$directed, TRUE) + expect_equal(res$weights, NULL) + expect_equal(res$type, "out") +}) + +test_that("a `...` of nothing but empty slots does not engage recovery", { + rlang::local_options(lifecycle_verbosity = "warning") + expect_no_warning(res <- migration_fixture("g", 5, , )) + expect_equal( + res, + list(graph = "g", n = 5, weights = NULL, type = "out", directed = FALSE) + ) +}) + +test_that("migrate_recover_args() skips empty slots but keeps their position", { + # `rlang::pairlist2()` is what the generated block hands over: it keeps an + # empty argument slot as the missing argument instead of forcing it. + expect_null(fixture_args(rlang::pairlist2())) + expect_null(fixture_args(rlang::pairlist2(,))) + + expect_equal( + fixture_args(rlang::pairlist2(, "in"))$values, + list(type = "in") + ) + expect_equal( + fixture_args(rlang::pairlist2(1:3, , TRUE))$values, + list(weights = 1:3, directed = TRUE) + ) + # A named slot left empty is not an argument either, and consumes no position. + expect_equal( + fixture_args(rlang::pairlist2(kind = , 1:3))$values, + list(weights = 1:3) + ) +}) + # ---- prefix-overlap fixture ------------------------------------------------- # migration_fixture_prefix(dimvector, p, ..., dim = NULL, permutation = NULL): diff --git a/tools/generate-migrations.R b/tools/generate-migrations.R index 96709c2a07e..2037cb45bd5 100644 --- a/tools/generate-migrations.R +++ b/tools/generate-migrations.R @@ -474,13 +474,22 @@ render_call_arg <- function(name, ctor, items, empty, trailing = ",") { # # Shape: the per-function configuration is passed to `migrate_recover_args()` # (a hand-written, debuggable helper) which returns the recovered values plus the -# deprecation message parts. The host frame then assigns the recovered values -# over its own locals and emits a single `lifecycle::deprecate_soft()`. Because -# that call sits directly in the host function, its default `user_env` -# (caller_env(2)) resolves to the user's frame -- no `.user_env` threading needed. +# deprecation message parts, or NULL when there is nothing to recover. The host +# frame then assigns the recovered values over its own locals and emits a single +# `lifecycle::deprecate_soft()`. Because that call sits directly in the host +# function, its default `user_env` (caller_env(2)) resolves to the user's frame +# -- no `.user_env` threading needed. +# +# `...` is collected with `rlang::pairlist2()` rather than `list()`: a call may +# leave an argument slot empty -- a trailing comma, or magrittr's +# `f(., , x = 1)` -- and `list(...)` forces such a slot into an "argument is +# missing, with no default" error (#2646). `pairlist2()` hands the empty slots +# over as the missing argument, and `migrate_recover_args()` skips them. # # The whole thing is guarded by `...length() > 0L` so the common path (a correct -# new-API call with nothing in `...`) skips the helper call entirely. +# new-API call with nothing in `...`) skips the helper call entirely. The NULL +# check covers a `...` that held nothing but empty slots: there is nothing to +# recover, and nothing to deprecate either. render_arg_handle <- function(entry) { keep <- intersect(entry$tail, names(entry$defaults)) default_items <- vapply( @@ -512,7 +521,7 @@ render_arg_handle <- function(entry) { "if (...length() > 0L) {", guard, " .arg_handle <- migrate_recover_args(", - " list(...),", + " rlang::pairlist2(...),", render_call_arg("current", "list", paste0(keep, " = ", keep), "list()"), render_call_arg("recover_new", "c", quote_items(entry$recover_new), "character(0)"), render_call_arg("recover_old", "c", quote_items(entry$recover_old), "character(0)"), @@ -522,12 +531,14 @@ render_arg_handle <- function(entry) { render_call_arg("head_args", "c", quote_items(entry$head), "character(0)"), paste0(" fn_name = \"", entry$fn, "\""), " )", - " list2env(.arg_handle$values, environment())", - " lifecycle::deprecate_soft(", - paste0(" \"", entry$when, "\","), - " what = I(.arg_handle$what),", - " details = .arg_handle$details", - " )", + " if (!is.null(.arg_handle)) {", + " list2env(.arg_handle$values, environment())", + " lifecycle::deprecate_soft(", + paste0(" \"", entry$when, "\","), + " what = I(.arg_handle$what),", + " details = .arg_handle$details", + " )", + " }", "}" ) }