https://github.com/cran/bayestestR
Revision 9985109256c08d654edb46adb9cb20c913fb1888 authored by Dominique Makowski on 29 May 2019, 14:10:02 UTC, committed by cran-robot on 29 May 2019, 14:10:02 UTC
1 parent fe07bfa
Raw File
Tip revision: 9985109256c08d654edb46adb9cb20c913fb1888 authored by Dominique Makowski on 29 May 2019, 14:10:02 UTC
version 0.2.0
Tip revision: 9985109
test-p_rope.R
context("p_rope")

test_that("p_rope", {
  testthat::expect_equal(as.numeric(p_rope(x = rnorm_perfect(1000, mean = 5, sd = 1), range = c(-0.1, 0.1))), 100, tolerance = 0.01)
  testthat::expect_equal(as.numeric(p_rope(x = rnorm_perfect(1000, mean = 1, sd = 1), range = c(-0.1, 0.1))), 63.1, tolerance = 0.01)
  testthat::expect_equal(as.numeric(p_rope(x = rnorm_perfect(1000, mean = -1, sd = 1), range = c(-0.1, 0.1))), 63.1, tolerance = 0.01)
  testthat::expect_equal(as.numeric(p_rope(x = rnorm_perfect(1000, mean = 0, sd = 1), range = c(-0.1, 0.1))), -7.9, tolerance = 0.01)
  testthat::expect_equal(as.numeric(p_rope(x = rnorm_perfect(1000, mean = 0, sd = 0.01), range = c(-0.1, 0.1))), -100, tolerance = 0.01)
})
back to top