Skip to content

Commit

Permalink
filter and informatively warn
Browse files Browse the repository at this point in the history
  • Loading branch information
JoFrhwld committed Sep 26, 2023
1 parent 29a32aa commit dab207f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions R/density_area.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,23 @@ density_polygons <- function(x,
repair = "unique",
quiet = TRUE)

na_filtered <- na_filter(x = x, y = y)

if(na_filtered$filtered){
x = na_filtered$values$x
y = na_filtered$values$y

x_total <- na_filtered$total$x
y_total <- na_filtered$total$y
cli::cli_warn(
c("Missing values dropped",
"i" = "{x_total} missing value{?s} in {xname}",
"i" = "{y_total} missing value{?s} in {yname}"
)
)
}


isolines <- get_isolines_safely(x=x, y=y, probs=probs, ...)

isolines |>
Expand Down

0 comments on commit dab207f

Please sign in to comment.