diff --git a/R/aaa-auto.R b/R/aaa-auto.R index 022e5b9128..cd706e2578 100644 --- a/R/aaa-auto.R +++ b/R/aaa-auto.R @@ -189,9 +189,9 @@ neighbors_impl <- function( # Argument checks ensure_igraph(graph) vid <- as_igraph_vs(graph, vid) - if (length(vid) == 0) { + if (length(vid) != 1) { cli::cli_abort( - "{.arg vid} must specify at least one vertex", + "{.arg vid} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -314,16 +314,16 @@ get_eid_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } to <- as_igraph_vs(graph, to) - if (length(to) == 0) { + if (length(to) != 1) { cli::cli_abort( - "{.arg to} must specify at least one vertex", + "{.arg to} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -381,16 +381,16 @@ get_all_eids_between_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } to <- as_igraph_vs(graph, to) - if (length(to) == 0) { + if (length(to) != 1) { cli::cli_abort( - "{.arg to} must specify at least one vertex", + "{.arg to} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -419,9 +419,9 @@ incident_impl <- function( # Argument checks ensure_igraph(graph) vid <- as_igraph_vs(graph, vid) - if (length(vid) == 0) { + if (length(vid) != 1) { cli::cli_abort( - "{.arg vid} must specify at least one vertex", + "{.arg vid} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -2481,16 +2481,16 @@ are_adjacent_impl <- function( # Argument checks ensure_igraph(graph) v1 <- as_igraph_vs(graph, v1) - if (length(v1) == 0) { + if (length(v1) != 1) { cli::cli_abort( - "{.arg v1} must specify at least one vertex", + "{.arg v1} must specify exactly one vertex", call = rlang::caller_env() ) } v2 <- as_igraph_vs(graph, v2) - if (length(v2) == 0) { + if (length(v2) != 1) { cli::cli_abort( - "{.arg v2} must specify at least one vertex", + "{.arg v2} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -2515,16 +2515,16 @@ are_connected_impl <- function( # Argument checks ensure_igraph(graph) v1 <- as_igraph_vs(graph, v1) - if (length(v1) == 0) { + if (length(v1) != 1) { cli::cli_abort( - "{.arg v1} must specify at least one vertex", + "{.arg v1} must specify exactly one vertex", call = rlang::caller_env() ) } v2 <- as_igraph_vs(graph, v2) - if (length(v2) == 0) { + if (length(v2) != 1) { cli::cli_abort( - "{.arg v2} must specify at least one vertex", + "{.arg v2} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -2758,16 +2758,16 @@ get_shortest_path_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } to <- as_igraph_vs(graph, to) - if (length(to) == 0) { + if (length(to) != 1) { cli::cli_abort( - "{.arg to} must specify at least one vertex", + "{.arg to} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -2807,16 +2807,16 @@ get_shortest_path_bellman_ford_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } to <- as_igraph_vs(graph, to) - if (length(to) == 0) { + if (length(to) != 1) { cli::cli_abort( - "{.arg to} must specify at least one vertex", + "{.arg to} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -2865,16 +2865,16 @@ get_shortest_path_dijkstra_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } to <- as_igraph_vs(graph, to) - if (length(to) == 0) { + if (length(to) != 1) { cli::cli_abort( - "{.arg to} must specify at least one vertex", + "{.arg to} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -2924,16 +2924,16 @@ get_shortest_path_astar_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } to <- as_igraph_vs(graph, to) - if (length(to) == 0) { + if (length(to) != 1) { cli::cli_abort( - "{.arg to} must specify at least one vertex", + "{.arg to} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -2982,9 +2982,9 @@ get_shortest_paths_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -3024,9 +3024,9 @@ get_all_shortest_paths_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -3152,9 +3152,9 @@ get_shortest_paths_dijkstra_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -3204,9 +3204,9 @@ get_shortest_paths_bellman_ford_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -3256,9 +3256,9 @@ get_all_shortest_paths_dijkstra_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -3469,9 +3469,9 @@ get_all_simple_paths_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -3523,16 +3523,16 @@ get_k_shortest_paths_impl <- function( } k <- as.numeric(k) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } to <- as_igraph_vs(graph, to) - if (length(to) == 0) { + if (length(to) != 1) { cli::cli_abort( - "{.arg to} must specify at least one vertex", + "{.arg to} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -3574,16 +3574,16 @@ get_widest_path_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } to <- as_igraph_vs(graph, to) - if (length(to) == 0) { + if (length(to) != 1) { cli::cli_abort( - "{.arg to} must specify at least one vertex", + "{.arg to} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -3632,9 +3632,9 @@ get_widest_paths_impl <- function( # Argument checks ensure_igraph(graph) from <- as_igraph_vs(graph, from) - if (length(from) == 0) { + if (length(from) != 1) { cli::cli_abort( - "{.arg from} must specify at least one vertex", + "{.arg from} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -3795,9 +3795,9 @@ subcomponent_impl <- function( # Argument checks ensure_igraph(graph) vid <- as_igraph_vs(graph, vid) - if (length(vid) == 0) { + if (length(vid) != 1) { cli::cli_abort( - "{.arg vid} must specify at least one vertex", + "{.arg vid} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -6236,9 +6236,9 @@ pseudo_diameter_impl <- function( # Argument checks ensure_igraph(graph) start_vid <- as_igraph_vs(graph, start_vid) - if (length(start_vid) == 0) { + if (length(start_vid) != 1) { cli::cli_abort( - "{.arg start_vid} must specify at least one vertex", + "{.arg start_vid} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -6276,9 +6276,9 @@ pseudo_diameter_dijkstra_impl <- function( weights <- NULL } start_vid <- as_igraph_vs(graph, start_vid) - if (length(start_vid) == 0) { + if (length(start_vid) != 1) { cli::cli_abort( - "{.arg start_vid} must specify at least one vertex", + "{.arg start_vid} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -6349,9 +6349,9 @@ random_walk_impl <- function( weights <- NULL } start <- as_igraph_vs(graph, start) - if (length(start) == 0) { + if (length(start) != 1) { cli::cli_abort( - "{.arg start} must specify at least one vertex", + "{.arg start} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -6404,9 +6404,9 @@ random_edge_walk_impl <- function( weights <- NULL } start <- as_igraph_vs(graph, start) - if (length(start) == 0) { + if (length(start) != 1) { cli::cli_abort( - "{.arg start} must specify at least one vertex", + "{.arg start} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -6665,9 +6665,9 @@ bfs_simple_impl <- function( # Argument checks ensure_igraph(graph) root <- as_igraph_vs(graph, root) - if (length(root) == 0) { + if (length(root) != 1) { cli::cli_abort( - "{.arg root} must specify at least one vertex", + "{.arg root} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -7716,9 +7716,9 @@ layout_star_impl <- function( # Argument checks ensure_igraph(graph) center <- as_igraph_vs(graph, center) - if (length(center) == 0) { + if (length(center) != 1) { cli::cli_abort( - "{.arg center} must specify at least one vertex", + "{.arg center} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -10414,16 +10414,16 @@ write_graph_dimacs_flow_impl <- function( check_string(outstream) source <- as_igraph_vs(graph, source) - if (length(source) == 0) { + if (length(source) != 1) { cli::cli_abort( - "{.arg source} must specify at least one vertex", + "{.arg source} must specify exactly one vertex", call = rlang::caller_env() ) } target <- as_igraph_vs(graph, target) - if (length(target) == 0) { + if (length(target) != 1) { cli::cli_abort( - "{.arg target} must specify at least one vertex", + "{.arg target} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -11238,9 +11238,9 @@ rooted_product_impl <- function( ensure_igraph(g1) ensure_igraph(g2) root <- as_igraph_vs(g2, root) - if (length(root) == 0) { + if (length(root) != 1) { cli::cli_abort( - "{.arg root} must specify at least one vertex", + "{.arg root} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -11292,16 +11292,16 @@ maxflow_impl <- function( # Argument checks ensure_igraph(graph) source <- as_igraph_vs(graph, source) - if (length(source) == 0) { + if (length(source) != 1) { cli::cli_abort( - "{.arg source} must specify at least one vertex", + "{.arg source} must specify exactly one vertex", call = rlang::caller_env() ) } target <- as_igraph_vs(graph, target) - if (length(target) == 0) { + if (length(target) != 1) { cli::cli_abort( - "{.arg target} must specify at least one vertex", + "{.arg target} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -11344,16 +11344,16 @@ maxflow_value_impl <- function( # Argument checks ensure_igraph(graph) source <- as_igraph_vs(graph, source) - if (length(source) == 0) { + if (length(source) != 1) { cli::cli_abort( - "{.arg source} must specify at least one vertex", + "{.arg source} must specify exactly one vertex", call = rlang::caller_env() ) } target <- as_igraph_vs(graph, target) - if (length(target) == 0) { + if (length(target) != 1) { cli::cli_abort( - "{.arg target} must specify at least one vertex", + "{.arg target} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -11506,16 +11506,16 @@ st_mincut_impl <- function( # Argument checks ensure_igraph(graph) source <- as_igraph_vs(graph, source) - if (length(source) == 0) { + if (length(source) != 1) { cli::cli_abort( - "{.arg source} must specify at least one vertex", + "{.arg source} must specify exactly one vertex", call = rlang::caller_env() ) } target <- as_igraph_vs(graph, target) - if (length(target) == 0) { + if (length(target) != 1) { cli::cli_abort( - "{.arg target} must specify at least one vertex", + "{.arg target} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -11558,16 +11558,16 @@ st_mincut_value_impl <- function( # Argument checks ensure_igraph(graph) source <- as_igraph_vs(graph, source) - if (length(source) == 0) { + if (length(source) != 1) { cli::cli_abort( - "{.arg source} must specify at least one vertex", + "{.arg source} must specify exactly one vertex", call = rlang::caller_env() ) } target <- as_igraph_vs(graph, target) - if (length(target) == 0) { + if (length(target) != 1) { cli::cli_abort( - "{.arg target} must specify at least one vertex", + "{.arg target} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -11602,16 +11602,16 @@ st_vertex_connectivity_impl <- function( # Argument checks ensure_igraph(graph) source <- as_igraph_vs(graph, source) - if (length(source) == 0) { + if (length(source) != 1) { cli::cli_abort( - "{.arg source} must specify at least one vertex", + "{.arg source} must specify exactly one vertex", call = rlang::caller_env() ) } target <- as_igraph_vs(graph, target) - if (length(target) == 0) { + if (length(target) != 1) { cli::cli_abort( - "{.arg target} must specify at least one vertex", + "{.arg target} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -11663,16 +11663,16 @@ st_edge_connectivity_impl <- function( # Argument checks ensure_igraph(graph) source <- as_igraph_vs(graph, source) - if (length(source) == 0) { + if (length(source) != 1) { cli::cli_abort( - "{.arg source} must specify at least one vertex", + "{.arg source} must specify exactly one vertex", call = rlang::caller_env() ) } target <- as_igraph_vs(graph, target) - if (length(target) == 0) { + if (length(target) != 1) { cli::cli_abort( - "{.arg target} must specify at least one vertex", + "{.arg target} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -11716,16 +11716,16 @@ edge_disjoint_paths_impl <- function( # Argument checks ensure_igraph(graph) source <- as_igraph_vs(graph, source) - if (length(source) == 0) { + if (length(source) != 1) { cli::cli_abort( - "{.arg source} must specify at least one vertex", + "{.arg source} must specify exactly one vertex", call = rlang::caller_env() ) } target <- as_igraph_vs(graph, target) - if (length(target) == 0) { + if (length(target) != 1) { cli::cli_abort( - "{.arg target} must specify at least one vertex", + "{.arg target} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -11750,16 +11750,16 @@ vertex_disjoint_paths_impl <- function( # Argument checks ensure_igraph(graph) source <- as_igraph_vs(graph, source) - if (length(source) == 0) { + if (length(source) != 1) { cli::cli_abort( - "{.arg source} must specify at least one vertex", + "{.arg source} must specify exactly one vertex", call = rlang::caller_env() ) } target <- as_igraph_vs(graph, target) - if (length(target) == 0) { + if (length(target) != 1) { cli::cli_abort( - "{.arg target} must specify at least one vertex", + "{.arg target} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -11822,9 +11822,9 @@ dominator_tree_impl <- function( # Argument checks ensure_igraph(graph) root <- as_igraph_vs(graph, root) - if (length(root) == 0) { + if (length(root) != 1) { cli::cli_abort( - "{.arg root} must specify at least one vertex", + "{.arg root} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -11858,16 +11858,16 @@ all_st_cuts_impl <- function( # Argument checks ensure_igraph(graph) source <- as_igraph_vs(graph, source) - if (length(source) == 0) { + if (length(source) != 1) { cli::cli_abort( - "{.arg source} must specify at least one vertex", + "{.arg source} must specify exactly one vertex", call = rlang::caller_env() ) } target <- as_igraph_vs(graph, target) - if (length(target) == 0) { + if (length(target) != 1) { cli::cli_abort( - "{.arg target} must specify at least one vertex", + "{.arg target} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -11898,16 +11898,16 @@ all_st_mincuts_impl <- function( # Argument checks ensure_igraph(graph) source <- as_igraph_vs(graph, source) - if (length(source) == 0) { + if (length(source) != 1) { cli::cli_abort( - "{.arg source} must specify at least one vertex", + "{.arg source} must specify exactly one vertex", call = rlang::caller_env() ) } target <- as_igraph_vs(graph, target) - if (length(target) == 0) { + if (length(target) != 1) { cli::cli_abort( - "{.arg target} must specify at least one vertex", + "{.arg target} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -13438,9 +13438,9 @@ fundamental_cycles_impl <- function( ensure_igraph(graph) if (!is.null(start)) { start <- as_igraph_vs(graph, start) - if (length(start) == 0) { + if (length(start) != 1) { cli::cli_abort( - "{.arg start} must specify at least one vertex", + "{.arg start} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -13719,9 +13719,9 @@ random_spanning_tree_impl <- function( ensure_igraph(graph) if (!is.null(vid)) { vid <- as_igraph_vs(graph, vid) - if (length(vid) == 0) { + if (length(vid) != 1) { cli::cli_abort( - "{.arg vid} must specify at least one vertex", + "{.arg vid} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -13870,9 +13870,9 @@ deterministic_optimal_imitation_impl <- function( # Argument checks ensure_igraph(graph) vid <- as_igraph_vs(graph, vid) - if (length(vid) == 0) { + if (length(vid) != 1) { cli::cli_abort( - "{.arg vid} must specify at least one vertex", + "{.arg vid} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -13954,9 +13954,9 @@ roulette_wheel_imitation_impl <- function( # Argument checks ensure_igraph(graph) vid <- as_igraph_vs(graph, vid) - if (length(vid) == 0) { + if (length(vid) != 1) { cli::cli_abort( - "{.arg vid} must specify at least one vertex", + "{.arg vid} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -13996,9 +13996,9 @@ stochastic_imitation_impl <- function( # Argument checks ensure_igraph(graph) vid <- as_igraph_vs(graph, vid) - if (length(vid) == 0) { + if (length(vid) != 1) { cli::cli_abort( - "{.arg vid} must specify at least one vertex", + "{.arg vid} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -14151,9 +14151,9 @@ vertex_path_from_edge_path_impl <- function( ensure_igraph(graph) if (!is.null(start)) { start <- as_igraph_vs(graph, start) - if (length(start) == 0) { + if (length(start) != 1) { cli::cli_abort( - "{.arg start} must specify at least one vertex", + "{.arg start} must specify exactly one vertex", call = rlang::caller_env() ) } diff --git a/tests/testthat/_snaps/aaa-auto.md b/tests/testthat/_snaps/aaa-auto.md index a34e62e8c4..5a5919e393 100644 --- a/tests/testthat/_snaps/aaa-auto.md +++ b/tests/testthat/_snaps/aaa-auto.md @@ -11820,13 +11820,21 @@ Error in `ensure_igraph()`: ! Must provide a graph object (provided `NULL`). +--- + + Code + get_eid_impl(graph = g, from = c(1, 2), to = 2) + Condition + Error: + ! `from` must specify exactly one vertex + --- Code get_eid_impl(graph = g, from = 1, to = integer(0)) Condition Error: - ! `to` must specify at least one vertex + ! `to` must specify exactly one vertex # community_voronoi_impl basic diff --git a/tests/testthat/_snaps/flow.md b/tests/testthat/_snaps/flow.md index add2f35391..61e2886e0f 100644 --- a/tests/testthat/_snaps/flow.md +++ b/tests/testthat/_snaps/flow.md @@ -4,7 +4,7 @@ st_cuts(g_path, source = "a", target = NULL) Condition Error in `st_cuts()`: - ! `target` must specify at least one vertex + ! `target` must specify exactly one vertex --- @@ -12,7 +12,7 @@ st_cuts(g_path, source = NULL, target = "a") Condition Error in `st_cuts()`: - ! `source` must specify at least one vertex + ! `source` must specify exactly one vertex --- @@ -20,7 +20,7 @@ st_min_cuts(g_path, source = "a", target = NULL) Condition Error in `st_min_cuts()`: - ! `target` must specify at least one vertex + ! `target` must specify exactly one vertex --- @@ -28,7 +28,7 @@ st_min_cuts(g_path, source = NULL, target = "a") Condition Error in `st_min_cuts()`: - ! `source` must specify at least one vertex + ! `source` must specify exactly one vertex # vertex_connectivity error works diff --git a/tests/testthat/test-aaa-auto.R b/tests/testthat/test-aaa-auto.R index 02ec2db379..0fc4aa57ed 100644 --- a/tests/testthat/test-aaa-auto.R +++ b/tests/testthat/test-aaa-auto.R @@ -11982,6 +11982,13 @@ test_that("get_eid_impl errors", { to = 2 )) + # Test error when from or to is not exactly one vertex + expect_snapshot_igraph_error(get_eid_impl( + graph = g, + from = c(1, 2), + to = 2 + )) + expect_snapshot_igraph_error(get_eid_impl( graph = g, from = 1, diff --git a/tools/stimulus/types-RR.yaml b/tools/stimulus/types-RR.yaml index 8f523c8f39..256959693a 100644 --- a/tools/stimulus/types-RR.yaml +++ b/tools/stimulus/types-RR.yaml @@ -196,9 +196,9 @@ VERTEX: CALL: '%I% - 1' INCONV: |- %I% <- as_igraph_vs(%I1%, %I%) - if (length(%I%) == 0) { + if (length(%I%) != 1) { cli::cli_abort( - "{.arg %I%} must specify at least one vertex", + "{.arg %I%} must specify exactly one vertex", call = rlang::caller_env() ) } @@ -229,9 +229,9 @@ VERTEX_ROOT: CALL: '%I% - 1' INCONV: |- %I% <- as_igraph_vs(%I1%, %I%) - if (length(%I%) == 0) { + if (length(%I%) != 1) { cli::cli_abort( - "{.arg %I%} must specify at least one vertex", + "{.arg %I%} must specify exactly one vertex", call = rlang::caller_env() ) }