tests/testthat/test-zapinf.R

context("sjmisc, zap_inf")

library(sjmisc)

test_that("zap_inf", {
  x <- c(1, 2, NA, 3, NaN, 4, NA, 5, Inf, -Inf, 6, 7)
  tmp <- zap_inf(x)
  expect_equal(any(is.infinite(tmp)), FALSE)
})

Try the sjmisc package in your browser

Any scripts or data that you put into this service are public.

sjmisc documentation built on Dec. 11, 2021, 9:34 a.m.