tests/testthat/test_getbetterint.R

test_that("works as expected", {
  
  # Errors.
  # No errors are currently implemented for this function.
  #expect_error( { ecopy( iris, showrowcolnames = "wrong", show = 'show' ) }, 'Value passed for .+ is not acceptable' )
  
  # Other tests.
  iris$bin <- binbyvol( iris, 'Sepal.Width', 'Sepal.Length', 5 )
  betterints = getbetterint( iris$bin ) # runs without error.
  expect_equal( length( iris$bin ), length( betterints ) ) # vector length should be the same.
  expect_equal( length( unique( iris$bin ) ), length( unique( betterints ) ) ) # number of buckets (unique values) should be the same.
  
})

Try the easyr package in your browser

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

easyr documentation built on March 31, 2023, 6:22 p.m.