Running ‘testsAtoC.R’ [4s/12s]
  Running ‘testsD.R’ [21s/50s]
  Running ‘testsEtoF.R’ [9s/19s]
  Running ‘testsGtoJ.R’
  Running ‘testsK.R’ [9s/18s]
  Running ‘testsL.R’ [59s/115s]
  Running ‘testsM.R’ [10s/19s]
  Running ‘testsNtoO.R’
  Running ‘testsP1.R’
  Running ‘testsP2.R’
  Running ‘testsQ.R’
  Running ‘testsR1.R’
  Running ‘testsR2.R’ [23s/37s]
  Running ‘testsS.R’
  Running ‘testsT.R’ [7s/11s]
  Running ‘testsUtoZ.R’ [10s/16s]
Running the tests in ‘tests/testsP2.R’ failed.
Complete output:
  > #'
  > #'   Header for all (concatenated) test files
  > #'
  > #'   Require spatstat.model
  > #'   Obtain environment variable controlling tests.
  > #'
  > #'   $Revision: 1.5 $ $Date: 2020/04/30 05:31:37 $
  > 
  > require(spatstat.model)
  Loading required package: spatstat.model
  Loading required package: spatstat.data
  Loading required package: spatstat.geom
  spatstat.geom 3.2-8
  Loading required package: spatstat.random
  spatstat.random 3.2-2
  Loading required package: spatstat.explore
  Loading required package: nlme
  spatstat.explore 3.2-6
  Loading required package: rpart
  spatstat.model 3.2-8
  > FULLTEST <- (nchar(Sys.getenv("SPATSTAT_TEST", unset="")) > 0)
  > ALWAYS   <- TRUE
  > cat(paste("--------- Executing",
  +           if(FULLTEST) "** ALL **" else "**RESTRICTED** subset of",
  +           "test code -----------\n"))
  --------- Executing **RESTRICTED** subset of test code -----------
  > # 
  > #   tests/ppmBadData.R
  > #
  > # $Revision: 1.6 $ $Date: 2020/04/30 05:23:52 $
  > 
  > # Testing robustness of ppm and support functions
  > # when data are rubbish
  > 
  > local({
  +   if(ALWAYS) {
  +     ## from Rolf: very large proportion of data is NA
  +     SEED <- 42
  +     K <- 101
  +     A <- 500
  +     X <- seq(0, A, length=K)
  +     G <- expand.grid(x=X, y=X)
  +     FOO <- function(x,y) { sin(x)^2 + cos(y)^2 }
  +     M1 <- im(matrix(FOO(G$x, G$y), K, K), xcol=X, yrow=X)
  +     M <- im(matrix(FOO(G$x, G$y), K, K))
  +     BAR <- function(x) { exp(-6.618913 + 5.855337 * x - 8.432483 * x^2) }
  +     V <- im(BAR(M$v), xcol=X, yrow=X)
  +     # V <- eval.im(exp(-6.618913 + 5.855337 * M - 8.432483 * M^2))
  +     set.seed(SEED)
  +     Y <- rpoispp(V)
  +     fY <- ppm(Y ~cv + I(cv^2), data=list(cv=M), correction="translate")
  +     diagnose.ppm(fY)
  +     lurking(fY, covariate=as.im(function(x,y){x}, square(A)), type="raw")
  +   }
  + 
  +   if(ALWAYS) {
  +     ## from Andrew Bevan: numerical overflow, ill-conditioned Fisher information
  +   SEED <- 42
  +     nongranite<- owin(poly = list(x = c(0, 8500, 7000, 6400, 6400, 6700, 7000, 7200, 7300, 8000, 8100, 8800, 9500, 10000, 10000, 0), y = c(0, 0, 2000, 3800, 4000, 5000, 6500, 7400, 7500, 8000, 8100, 9000, 9500, 9600, 10000, 10000)))
  +     ## Trend on raster grid
  +     rain <- as.im(X=function(x,y) { x^2 + y^2 }, W=nongranite, dimyx=100)
  +     ## Generate a point pattern via a Lennard-Jones process
  +     set.seed(SEED)
  +     mod4<- rmhmodel(cif="lennard",
  +                     par=list(beta=1, sigma=250, epsilon=2.2),
  +                     trend=rain, w=nongranite)
  +     ljtr<- rmh(mod4, start=list(n.start=80), control=list(p=1, nrep=1e5))
  + 
  +     ## Fit a point process model to the pattern with rain as a covariate
  +     ## NOTE INCORRECT TREND FORMULA
  +     ljtrmod <- ppm(ljtr, trend= ~ Z, interaction=NULL, data=list(Z=rain))
  +     ss <- summary(ljtrmod)
  +   }
  +   
  +   if(FULLTEST) {
  +     ## From Ege
  +     ## Degenerate but non-null argument 'covariates'
  +     xx <- list()
  +     names(xx) <- character(0)
  +     fit <- ppm(cells ~x, covariates = xx)
  +     st <- summary(fit) 
  +   }
  + 
  + })
  Error in check.nvector(weights, nX, vname = "weights") : 
    Some values of weights are NA or NaN
  Calls: local ... diagnose.ppm.engine -> density.ppp -> pointweights -> check.nvector
  In addition: Warning messages:
  1: Values of the covariate 'cv' were NA or undefined at 96% (1774 out of 1845) of the quadrature points. Occurred while executing: ppm.ppp(Q = Y, trend = ~cv + I(cv^2), data = list(list(c(1, 1.91953576453823,  
  2: Some infinite, NA or NaN increments were removed 
  3: Numerical underflow detected: sigma is probably too small 
  Execution halted