/usr/lib/R/site-library/lambda.r/unitTests/runit.heaviside_step.2.R is in r-cran-lambda.r 1.1.9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 | test.heaviside_2 <- function() {
h.step(n) %::% numeric : numeric
h.step(n) %when% { n < 0 } %as% { 0 }
h.step(0) %as% 0.5
h.step(n) %as% 1
seal(h.step)
checkEquals(h.step(-1), 0)
checkEquals(h.step(0), 0.5)
checkEquals(h.step(1), 1)
# TODO: This throws an error in the shell but not via RUnit
#checkException(h.step("a"))
}
|