Skip to content

Commit

Permalink
-Inf warn
Browse files Browse the repository at this point in the history
  • Loading branch information
Toby Dylan Hocking committed Nov 28, 2024
1 parent 66c1356 commit b03991a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions R/geom-.r
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,6 @@ Geom <- gganimintproto("Geom",
if(any(repNA)){
to.rep[repNA] <- FALSE
}
origNA <- is.na(l$data)[, xy.col.vec, drop=FALSE]
warnNA <- repNA & !origNA
if(any(warnNA)){
warning("NA found in code for handling infinite values. Typically this means that user should change -Inf to 0 when using scale_log10 etc")
}
row.vec <- row(to.rep)[to.rep]
xy.col.df[to.rep] <- extreme.vec[row.vec]
}
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-compiler-errors.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ test_that("warn for -Inf but not NA input to scale_log10", {
viz_neg_Inf <- get_viz(-Inf)
expect_warning({
animint2dir(viz_neg_Inf, open.browser=FALSE)
}, "NA found in code for handling infinite values. Typically this means that user should change -Inf to 0 when using scale_log10 etc")
}, "NaNs produced")
viz_NA <- get_viz(NA)
expect_no_warning({
animint2dir(viz_NA, open.browser=FALSE)
}, "NA found in code for handling infinite values. Typically this means that user should change -Inf to 0 when using scale_log10 etc")
})
})

test_that("warn no key for geom_text with showSelected=duration var", {
Expand Down

0 comments on commit b03991a

Please sign in to comment.