Skip to content

Commit

Permalink
error
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed Mar 6, 2025
1 parent a09f8c2 commit eee5f96
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions R/motifs.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,7 @@ motifs <- function(graph, size = 3, cut.prob = NULL) {
if (!is.null(cut.prob)) cut.prob <- as.numeric(cut.prob)

if (!is.null(cut.prob) && length(cut.prob) != size) {
cut.prob <- c(
cut.prob[-length(cut.prob)],
rep(cut.prob[-length(cut.prob)], length(cut.prob) - 1)
)
cli::cli_abort("{arg cut.prob} must be the same length as {.arg size}")
}

on.exit(.Call(R_igraph_finalizer))
Expand Down Expand Up @@ -178,10 +175,7 @@ count_motifs <- function(graph, size = 3, cut.prob = NULL) {
if (!is.null(cut.prob)) cut.prob <- as.numeric(cut.prob)

if (!is.null(cut.prob) && length(cut.prob) != size) {
cut.prob <- c(
cut.prob[-length(cut.prob)],
rep(cut.prob[-length(cut.prob)], length(cut.prob) - 1)
)
cli::cli_abort("{arg cut.prob} must be the same length as {.arg size}")
}

on.exit(.Call(R_igraph_finalizer))
Expand Down Expand Up @@ -234,10 +228,7 @@ sample_motifs <- function(
if (!is.null(cut.prob)) cut.prob <- as.numeric(cut.prob)

if (!is.null(cut.prob) && length(cut.prob) != size) {
cut.prob <- c(
cut.prob[-length(cut.prob)],
rep(cut.prob[-length(cut.prob)], length(cut.prob) - 1)
)
cli::cli_abort("{arg cut.prob} must be the same length as {.arg size}")
}

if (is.null(sample)) {
Expand Down

0 comments on commit eee5f96

Please sign in to comment.