Running 'test.R' [179s]
  Running 'test_modal.R' [6s]
  Running 'test_moments.R' [6s]
  Running 'test_quantile.R' [160s]
Running the tests in 'tests/test.R' failed.
Complete output:
  > library(rasterKernelEstimates)
  > 
  > set.seed(100)
  > 
  > cmdArgs <- commandArgs(trailingOnly = TRUE)
  > if( !('n' %in% ls() ))n=as.numeric(cmdArgs[1])
  > if( !('m' %in% ls() ))m=as.numeric(cmdArgs[2])
  > 
  > # check if we got something
  > if(is.na(n)) n <-  50
  > if(is.na(m)) m <- 9 
  > 
  > print(n)
  [1] 50
  > print(m)
  [1] 9
  > 
  > # create a raster object
  > r <- raster::raster( matrix(rnorm(n^2),n,n))
  > 
  > print( format(object.size(r), units = "auto")) 
  [1] "31.9 Kb"
  > 
  > # create a weight matrix
  > W <-  matrix(1/m^2,m,m )
  > 
  > # apply the weight with rasterKernelEstimates
  > run.time <- proc.time()
  > rLocalKDE1 <- rasterLocalSums(r,W)
  > print(proc.time() - run.time)
     user  system elapsed 
        0       0       0 
  > 
  > run.time <- proc.time()
  > rLocalKDE2 <- raster::focal(r,W,pad=TRUE)
  > print(proc.time() - run.time)
     user  system elapsed 
     0.08    0.00    0.07 
  > 
  > # print out the max abs difference
  > print(
  + sprintf(
  + "The maximum absolute difference = %f.",
  + max(abs(raster::values(rLocalKDE1) - raster::values(rLocalKDE2)
  + ),na.rm = T))
  + )
  [1] "The maximum absolute difference = 0.000000."
  > 
  > proc.time()
     user  system elapsed 
     6.04    0.28    6.32 
Running the tests in 'tests/test_quantile.R' failed.
Complete output:
  > library(rasterKernelEstimates)
  > 
  > set.seed(100)
  > 
  > cmdArgs <- commandArgs(trailingOnly = TRUE)
  > if( !('n' %in% ls() ))n=as.numeric(cmdArgs[1])
  > if( !('m' %in% ls() ))m=as.numeric(cmdArgs[2])
  > 
  > # check if we got something
  > if(is.na(n)) n <- 50 
  > if(is.na(m)) m <- 9 
  > 
  > print(n)
  [1] 50
  > print(m)
  [1] 9
  > 
  > # create a raster object with extreme values
  > r <- raster::raster( matrix(rcauchy(n^2),n,n))
  > 
  > # create a weight matrix
  > W <- matrix(1,nrow=m,ncol=m)
  > 
  > # calculate local median
  > run.time <- proc.time()
  > rLocalKDE1 <- rasterLocalQuantiles(r,W,q=30)
  > print(proc.time() - run.time)
     user  system elapsed 
        0       0       0 
  > 
  > # calculate the local median using focal
  > run.time <- proc.time()
  > rLocalKDE2 <- raster::focal( r, W, pad=TRUE, fun=function(x) stats::quantile(x,probs=0.3,na.rm=T,type=1), padValue=NA)
  > print(proc.time() - run.time)
     user  system elapsed 
     0.49    0.03    0.52 
  > 
  > print( sprintf( "The maximum absolute difference = %f.", max(abs(raster::values(rLocalKDE1) - raster::values(rLocalKDE2)),na.rm = T)))
  [1] "The maximum absolute difference = 0.000000."
  > 
  > 
  > 
  > 
  > 
  > proc.time()
     user  system elapsed 
     6.59    0.23    6.81