Skip to content

Commit

Permalink
feat: use cli::cli_warn() in data_ferame.R
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed Oct 15, 2024
1 parent 3f5db2c commit efbad8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/data_frame.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ graph_from_data_frame <- function(d, directed = TRUE, vertices = NULL) {

## Handle if some elements are 'NA'
if (any(is.na(d[, 1:2]))) {
warning("In `d' `NA' elements were replaced with string \"NA\"")
cli::cli_warn("In {.code d}, {.code NA} elements were replaced with string {.str NA}.")
d[, 1:2][is.na(d[, 1:2])] <- "NA"
}
if (!is.null(vertices) && any(is.na(vertices[, 1]))) {
warning("In `vertices[,1]' `NA' elements were replaced with string \"NA\"")
warning("In {.code vertices[,1]}, {.code NA} elements were replaced with string {.str NA}.")
vertices[, 1][is.na(vertices[, 1])] <- "NA"
}

Expand Down

0 comments on commit efbad8b

Please sign in to comment.