tests/testthat/test-clip_at_sd.r

context('Clipping numeric vector at standard deviation')

test_that('Function returns clipped version', {
    v = rep(c(rep(0, 100),100,-100))
    expect_equal(round(ClipAtSd(v, clip.at.sd = 2), 2), c(rep(0, 100), 28.14, -28.14))
    
})
petersmittenaar/peterr documentation built on Feb. 13, 2021, 9:20 p.m.