tests/testthat/programs/dstest.R

library(fmtr)

myfmt <- value(condition(x >= 20, "High"),
               condition(x < 20, "Low"))


d1 <- datastep(mtcars, {
  
  mpgcat <- fapply(mpg, myfmt)
  
})


d1


if (!"mpgcat" %in% names(d1))
  stop("Mpgcat missing")


if (d1$mpgcat[1] != "High")
  stop("Mpgcat value not High")
dbosak01/libr documentation built on March 19, 2024, 5:50 p.m.