Running ‘RFsimulate.R’ [17s/17s]
  Running ‘krige.R’ [11s/11s]
  Running ‘lgcp.R’
  Running ‘lgm.R’ [23s/24s]
  Running ‘lgmRaster.R’ [122s/69s]
  Running ‘likfitLgm.R’ [14s/15s]
  Running ‘matern.R’
  Running ‘maternGmrfPrec.R’ [15s/15s]
  Running ‘profLlgm.R’ [19s/16s]
  Running ‘simLgcp.R’ [10s/10s]
  Running ‘stackRasterList.R’
Running the tests in ‘tests/lgmRaster.R’ failed.
Complete output:
  > #+ setup
  > library('geostatsp')
  Loading required package: Matrix
  Loading required package: raster
  Loading required package: sp
  > #'
  > 
  > #' # simulated data
  > 
  > 
  > #+ simData
  > if(.Platform$OS.type == 'windows') {
  + 	Ncell =  30
  + } else {
  + 	Ncell = 40
  + }
  > myRaster = squareRaster(extent(0,6000,0,6000), Ncell)
  > 
  > myParam=c(oneminusar=0.1, conditionalVariance=2.5^2,shape=2)
  > myQ = maternGmrfPrec(myRaster, param=myParam)
  > attributes(myQ)$info$optimalShape
       shape   variance      range   cellSize 
    4.092496 110.524266 900.000000 150.000000 
  > set.seed(0)
  > mySim = RFsimulate(attributes(myQ)$info$optimalShape, myRaster)
  New output format of RFsimulate: S4 object of class 'RFsp';
  for a bare, but faster array format use 'RFoptions(spConform=FALSE)'.
  > 
  > otherPar = c(intercept=1, beta = 2, tau=10)
  > myCov = myRaster
  > values(myCov) = rep(seq(-1,1,len=ncol(myCov)), nrow(myCov))
  > 
  > myLambda = otherPar['intercept'] + otherPar['beta'] * myCov + mySim
  > myY = myLambda
  > values(myY)=rnorm(prod(dim(myLambda)),values(myLambda), sd=otherPar['tau']) 
  > 
  > names(myCov) = 'x'
  > names(myY) = gsub("^layer\\.","sim", names(mySim))
  > #'
  > 
  > 
  > 
  > #+ plotSim, fig.cap='simulated data', fig.subcap =c('random effect','observed')
  > plot(mySim)
  > 
  > plot(myY)
  > #'
  > 
  > #' grid search	
  > 
  > #+ simGrid
  > myResR = lgm(formula = sim ~ x, 
  +     data=raster::stack(myY, myCov), 
  +     oneminusar = exp(seq(log(0.05), log(0.2),len=25)),
  +     nugget = exp(seq(log(5), log(100),len=21)), shape=2, 
  +     adjustEdges=TRUE,
  +     mc.cores=1+(.Platform$OS.type=='unix') )		
  > #'
  > 
  > #+ simPlot
  > Sbreaks = c(-100000,-50,-20,-10, -5,  -2, -1,0)
  > 
  > myCol = mapmisc::colourScale(
  +     breaks = Sbreaks + max(myResR$array[,-1,'logLreml',], na.rm=TRUE),
  +     style='fixed',
  +     col=terrain.colors
  + )
  Error in loadNamespace(name) : there is no package called 'mapmisc'
  Calls: :: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
  Execution halted