tests/linbin.R

library(bpkde)

if(require(KernSmooth)) {
  datasets <- data(package = "bpkde")$results[, 3]

  for(d in datasets) {
    data(list = d)
    mat <- get(d)
    x <- seq(min(mat[, 1]) - 1, max(mat[, 1]) + 1, length = 100)
    y <- seq(min(mat[, 2]) - 1, max(mat[, 2]) + 1, length = 100)
    ks <- KernSmooth:::linbin2D(mat, x, y)
    me <- bpkde:::linbin2D(mat, x, y)
    print(d)
    stopifnot(all.equal(ks, me))
  }
}

Try the bpkde package in your browser

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

bpkde documentation built on May 30, 2017, 1:52 a.m.