https://github.com/cran/spatstat
Raw File
Tip revision: edc49ab1e55bf5475be2f4d0987c835f45800ebc authored by Adrian Baddeley on 08 October 2015, 13:43:38 UTC
version 1.43-0
Tip revision: edc49ab
is.cadlag.R
is.cadlag <- function (s) 
{
if(!is.stepfun(s)) stop("s is not a step function.\n")
r <- knots(s)
h <- s(r)
n <- length(r)
r1 <- c(r[-1],r[n]+1)
rm <- (r+r1)/2
hm <- s(rm)
identical(all.equal(h,hm),TRUE)
}
back to top