tests/testthat/test_ifelse.R

context("Ifelse works correct")

test_that("Implicit vectorisation",{
  p = c(-0.5, 1, 1.5)
  result = c(-0.5,0,0)
  test = p>0
  yes = 0
  no = p
  expect_equal(ifelseC(p>0,0,p), result)
}
          )

Try the ojUtils package in your browser

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

ojUtils documentation built on Sept. 21, 2018, 6:25 p.m.