Running ‘RFsimulate.R’ [14s/20s]
  Running ‘krige.R’ [15s/19s]
  Running ‘lgcp.R’ [21s/30s]
  Running ‘lgm.R’ [24s/28s]
  Running ‘lgmRaster.R’ [14s/19s]
  Running ‘likfitLgm.R’ [14s/19s]
  Running ‘matern.R’ [14s/18s]
  Running ‘maternGmrfPrec.R’ [18s/22s]
  Running ‘profLlgm.R’ [23s/24s]
  Running ‘simLgcp.R’ [14s/21s]
  Running ‘stackRasterList.R’ [13s/16s]
Running the tests in ‘tests/RFsimulate.R’ failed.
Complete output:
  > library("geostatsp")
  Loading required package: Matrix
  Loading required package: raster
  Loading required package: sp
  > 
  > model <- c(var=5, range=20,shape=0.5)
  > 
  > # any old crs
  > theCrs = CRS("+proj=utm +zone=17 +datum=NAD27 +units=m +no_defs")
  > 
  > if (requireNamespace("RandomFields", quietly = TRUE)) { 
  +   myraster = raster(nrows=50,ncols=50,xmn=100,ymn=100,xmx=110,ymx=110, 
  +     crs=theCrs)
  + } else {
  +   myraster = raster(nrows=20,ncols=20,xmn=100,ymn=100,xmx=110,ymx=110, 
  +     crs=theCrs)
  + }
  > 
  > set.seed(0)
  > simu = RFsimulate(rbind(a=model, b=model+0.1), 
  +   x=myraster, n=3
  + )
  
   *** caught segfault ***
  address (nil), cause 'unknown'
  
  Traceback:
   1: RandomFieldsUtils::RFoptions()
   2: internal.rfoptions(xyz_notation = length(y) != 0, expected_number_simu = n,     ..., RELAX = !missing(model) && is(model, "formula"))
   3: (function (model, x, y = NULL, z = NULL, T = NULL, grid = NULL,     distances, dim, data, given = NULL, err.model, params, err.params,     n = 1, ...) {    if (!missing(model) && is(model, "RFfit"))         stop("To continue with the output of 'RFfit' use 'predict' or give the components separately")    mc <- as.character(deparse(match.call()))    if (!missing(distances) && length(distances) > 0)         RFoptOld <- internal.rfoptions(xyz_notation = length(y) !=             0, expected_number_simu = n, ..., general.spConform = FALSE,             RELAX = !missing(model) && is(model, "formula"))    else RFoptOld <- internal.rfoptions(xyz_notation = length(y) !=         0, expected_number_simu = n, ..., RELAX = !missing(model) &&         is(model, "formula"))    on.exit(RFoptions(LIST = RFoptOld[[1]]))    RFopt <- RFoptOld[[2]]    if (n > 2 && RFopt$internal$examples_reduced) {        message("number of simulations reduced")        n <- 2    }    cond.simu <- !missing(data) && !is.null(data)    reg <- RFopt$registers$register    mcall <- as.list(match.call(expand.dots = FALSE))    if (length(mcall) == 1 || length(mcall) == 2 && !is.null(mcall$n) ||         length(mcall) == 3 && !is.null(mcall$n) && "..." %in%             names(mcall)) {        if (cond.simu) {            stop("repeated performance of conditional simulation not programmed yet")        }        else {            res <- rfDoSimulate(n = n, reg = reg, spConform = RFopt$general$spConform)            if (RFopt$general$returncall)                 attr(res, "call") <- mc            attr(res, "coord_system") <- .Call(C_GetCoordSystem,                 reg, RFopt$coords$coord_system, RFopt$coords$new_coord_system)            return(res)        }    }    stopifnot(!missing(model) && !is.null(model))    model.orig <- model    model <- PrepareModel2(model, params = params, ...)    err.model <- if (missing(err.model))         NULL    else PrepareModel2(err.model, params = err.params, ...)    if (cond.simu) {        if (isSpObj(data))             data <- sp2RF(data)        stopifnot(missing(distances) || is.null(distances))        res <- switch(GetProcessType(model), RPgauss = rfCondGauss(model = model.orig,             x = x, y = y, z = z, T = T, grid = grid, n = n, data = data,             given = given, err.model = err.model, predict_register = MODEL_PREDICT,             ...), stop(GetProcessType(model), ": conditional simulation of the process not programmed yet"))    }    else {        if (!is.null(err.model))             warning("error model is unused in unconditional simulation")        warn.seed.not.na(RFoptOld)        if (exists(".Random.seed") && !is.na(RFopt$basic$seed)) {            .old.seed <- .Random.seed            on.exit(set.seed(.old.seed), add = TRUE)        }        rfInit(model = list("Simulate", setseed = eval(parse(text = "quote(set.seed(seed=seed))")),             env = .GlobalEnv, model), x = x, y = y, z = z, T = T,             grid = grid, distances = distances, dim = dim, reg = reg,             RFopt = RFopt, y.ok = FALSE)        if (n < 1)             return(NULL)        res <- rfDoSimulate(n = n, reg = reg, spConform = FALSE)    }    if ((!cond.simu || (!missing(x) && length(x) != 0)) && RFopt$general$spConform) {        info <- RFgetModelInfo(if (cond.simu)             MODEL_PREDICT        else reg, level = 3)        if (length(res) > 1e+07) {            message("Too big data set (more than 1e7 entries) to allow for 'spConform=TRUE'. So the data are returned as if 'spConform=FALSE'")            return(res)        }        prep <- prepare4RFspDataFrame(info, RFopt, x, y, z, T,             grid, coordnames = attributes(res)$coordnames)        attributes(res)$varnames <- attributes(res)$varnames        res <- conventional2RFspDataFrame(data = res, coords = prep$coords,             gridTopology = prep$gridTopology, n = n, vdim = info$vdim,             T = info$loc$T, vdim_close_together = RFopt$general$vdim_close_together)        if (is.raster(x)) {            res <- raster::raster(res)            raster::projection(res) <- raster::projection(x)        }    }    if (RFopt$general$returncall)         attr(res, "call") <- mc    attr(res, "coord_system") <- .Call(C_GetCoordSystem, as.integer(reg),         RFopt$coords$coord_system, RFopt$coords$new_coord_system)    return(res)})(x = new("GridTopology", cellcentre.offset = c(s1 = 100.1, s2 = 100.1), cellsize = c(0.2, 0.2), cells.dim = c(50L, 50L)),     model = new("RMmodel", call = RandomFields::RMmatern(nu = param["shape"],         var = param["variance"], scale = param["scaleRandomFields"]),         name = "RMmatern", submodels = list(), par.model = list(            nu = c(shape = 0.6)), par.general = list(var = c(variance = 5.1),             scale = c(scaleRandomFields = 10.05))), n = 1, spConform = TRUE)
   4: do.call(RandomFields::RFsimulate, theArgs)
   5: RFsimulate(model, x, data = data, err.model = err.model, n = n,     ...)
   6: RFsimulate(model, x, data = data, err.model = err.model, n = n,     ...)
   7: eval(call, parent.frame())
   8: eval(call, parent.frame())
   9: callGeneric(model, x, data = data, err.model = err.model, n = n,     ...)
  10: RFsimulate(model = model, x = x, data = data, err.model = err.model,     n = n, ...)
  11: RFsimulate(model = model, x = x, data = data, err.model = err.model,     n = n, ...)
  12: eval(call, parent.frame())
  13: eval(call, parent.frame())
  14: callGeneric(model = model, x = x, data = data, err.model = err.model,     n = n, ...)
  15: RFsimulate(model = model[D, ], x = x, data = data[, D], err.model = err.model[D],     n = 1, ...)
  16: RFsimulate(model = model[D, ], x = x, data = data[, D], err.model = err.model[D],     n = 1, ...)
  17: eval(call, parent.frame())
  18: eval(call, parent.frame())
  19: callGeneric(model = model[D, ], x = x, data = data[, D], err.model = err.model[D],     n = 1, ...)
  20: RFsimulate(rbind(a = model, b = model + 0.1), x = myraster, n = 3)
  21: RFsimulate(rbind(a = model, b = model + 0.1), x = myraster, n = 3)
  An irrecoverable exception occurred. R is aborting now ...
Running the tests in ‘tests/lgmRaster.R’ failed.
Complete output:
  > options("rgdal_show_exportToProj4_warnings"="none") 
  > #+ 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)
  
   *** caught segfault ***
  address (nil), cause 'unknown'
  
  Traceback:
   1: RandomFieldsUtils::RFoptions()
   2: internal.rfoptions(xyz_notation = length(y) != 0, expected_number_simu = n,     ..., RELAX = !missing(model) && is(model, "formula"))
   3: (function (model, x, y = NULL, z = NULL, T = NULL, grid = NULL,     distances, dim, data, given = NULL, err.model, params, err.params,     n = 1, ...) {    if (!missing(model) && is(model, "RFfit"))         stop("To continue with the output of 'RFfit' use 'predict' or give the components separately")    mc <- as.character(deparse(match.call()))    if (!missing(distances) && length(distances) > 0)         RFoptOld <- internal.rfoptions(xyz_notation = length(y) !=             0, expected_number_simu = n, ..., general.spConform = FALSE,             RELAX = !missing(model) && is(model, "formula"))    else RFoptOld <- internal.rfoptions(xyz_notation = length(y) !=         0, expected_number_simu = n, ..., RELAX = !missing(model) &&         is(model, "formula"))    on.exit(RFoptions(LIST = RFoptOld[[1]]))    RFopt <- RFoptOld[[2]]    if (n > 2 && RFopt$internal$examples_reduced) {        message("number of simulations reduced")        n <- 2    }    cond.simu <- !missing(data) && !is.null(data)    reg <- RFopt$registers$register    mcall <- as.list(match.call(expand.dots = FALSE))    if (length(mcall) == 1 || length(mcall) == 2 && !is.null(mcall$n) ||         length(mcall) == 3 && !is.null(mcall$n) && "..." %in%             names(mcall)) {        if (cond.simu) {            stop("repeated performance of conditional simulation not programmed yet")        }        else {            res <- rfDoSimulate(n = n, reg = reg, spConform = RFopt$general$spConform)            if (RFopt$general$returncall)                 attr(res, "call") <- mc            attr(res, "coord_system") <- .Call(C_GetCoordSystem,                 reg, RFopt$coords$coord_system, RFopt$coords$new_coord_system)            return(res)        }    }    stopifnot(!missing(model) && !is.null(model))    model.orig <- model    model <- PrepareModel2(model, params = params, ...)    err.model <- if (missing(err.model))         NULL    else PrepareModel2(err.model, params = err.params, ...)    if (cond.simu) {        if (isSpObj(data))             data <- sp2RF(data)        stopifnot(missing(distances) || is.null(distances))        res <- switch(GetProcessType(model), RPgauss = rfCondGauss(model = model.orig,             x = x, y = y, z = z, T = T, grid = grid, n = n, data = data,             given = given, err.model = err.model, predict_register = MODEL_PREDICT,             ...), stop(GetProcessType(model), ": conditional simulation of the process not programmed yet"))    }    else {        if (!is.null(err.model))             warning("error model is unused in unconditional simulation")        warn.seed.not.na(RFoptOld)        if (exists(".Random.seed") && !is.na(RFopt$basic$seed)) {            .old.seed <- .Random.seed            on.exit(set.seed(.old.seed), add = TRUE)        }        rfInit(model = list("Simulate", setseed = eval(parse(text = "quote(set.seed(seed=seed))")),             env = .GlobalEnv, model), x = x, y = y, z = z, T = T,             grid = grid, distances = distances, dim = dim, reg = reg,             RFopt = RFopt, y.ok = FALSE)        if (n < 1)             return(NULL)        res <- rfDoSimulate(n = n, reg = reg, spConform = FALSE)    }    if ((!cond.simu || (!missing(x) && length(x) != 0)) && RFopt$general$spConform) {        info <- RFgetModelInfo(if (cond.simu)             MODEL_PREDICT        else reg, level = 3)        if (length(res) > 1e+07) {            message("Too big data set (more than 1e7 entries) to allow for 'spConform=TRUE'. So the data are returned as if 'spConform=FALSE'")            return(res)        }        prep <- prepare4RFspDataFrame(info, RFopt, x, y, z, T,             grid, coordnames = attributes(res)$coordnames)        attributes(res)$varnames <- attributes(res)$varnames        res <- conventional2RFspDataFrame(data = res, coords = prep$coords,             gridTopology = prep$gridTopology, n = n, vdim = info$vdim,             T = info$loc$T, vdim_close_together = RFopt$general$vdim_close_together)        if (is.raster(x)) {            res <- raster::raster(res)            raster::projection(res) <- raster::projection(x)        }    }    if (RFopt$general$returncall)         attr(res, "call") <- mc    attr(res, "coord_system") <- .Call(C_GetCoordSystem, as.integer(reg),         RFopt$coords$coord_system, RFopt$coords$new_coord_system)    return(res)})(x = new("GridTopology", cellcentre.offset = c(s1 = 75, s2 = 75), cellsize = c(150, 150), cells.dim = c(40L, 40L)), model = new("RMmodel",     call = RandomFields::RMmatern(nu = param["shape"], var = param["variance"],         scale = param["scaleRandomFields"]), name = "RMmatern",     submodels = list(), par.model = list(nu = c(shape = 4.09249575635556)),     par.general = list(var = c(variance = 110.524266036038),         scale = c(scaleRandomFields = 450))), n = 1, spConform = TRUE)
   4: do.call(RandomFields::RFsimulate, theArgs)
   5: RFsimulate(model, x, data = data, err.model = err.model, n = n,     ...)
   6: RFsimulate(model, x, data = data, err.model = err.model, n = n,     ...)
   7: eval(call, parent.frame())
   8: eval(call, parent.frame())
   9: callGeneric(model, x, data = data, err.model = err.model, n = n,     ...)
  10: RFsimulate(model = model, x = x, data = data, err.model = err.model,     n = n, ...)
  11: RFsimulate(model = model, x = x, data = data, err.model = err.model,     n = n, ...)
  12: eval(call, parent.frame())
  13: eval(call, parent.frame())
  14: callGeneric(model = model, x = x, data = data, err.model = err.model,     n = n, ...)
  15: RFsimulate(attributes(myQ)$info$optimalShape, myRaster)
  16: RFsimulate(attributes(myQ)$info$optimalShape, myRaster)
  An irrecoverable exception occurred. R is aborting now ...
Running the tests in ‘tests/likfitLgm.R’ failed.
Complete output:
  > options("rgdal_show_exportToProj4_warnings"="none") 
  > library('geostatsp')
  Loading required package: Matrix
  Loading required package: raster
  Loading required package: sp
  > 
  > if(interactive()  | Sys.info()['user'] =='patrick') {
  +   n=300
  + } else {
  +   n=100
  + }
  > 
  > set.seed(0)
  > mydat = SpatialPointsDataFrame(cbind(seq(0,1,len=n), runif(n)), 
  + 		data=data.frame(cov1 = rnorm(n), cov2 = rpois(n, 0.5))
  + )
  > 
  > 
  > 	
  > 
  > trueParamAniso = c(
  +     variance=2^2, range=0.2, shape=2,
  + 		nugget=1^2,anisoRatio=4,anisoAngleDegrees=10)
  > 
  > trueParamIso = c(
  +     variance=2^2, range=0.2, shape=2,
  +     nugget=1^2)
  > 
  > 
  > mydat$U = geostatsp::RFsimulate(trueParamAniso,mydat)$sim
  
   *** caught segfault ***
  address (nil), cause 'unknown'
  
  Traceback:
   1: RandomFieldsUtils::RFoptions()
   2: internal.rfoptions(xyz_notation = length(y) != 0, expected_number_simu = n,     ..., RELAX = !missing(model) && is(model, "formula"))
   3: (function (model, x, y = NULL, z = NULL, T = NULL, grid = NULL,     distances, dim, data, given = NULL, err.model, params, err.params,     n = 1, ...) {    if (!missing(model) && is(model, "RFfit"))         stop("To continue with the output of 'RFfit' use 'predict' or give the components separately")    mc <- as.character(deparse(match.call()))    if (!missing(distances) && length(distances) > 0)         RFoptOld <- internal.rfoptions(xyz_notation = length(y) !=             0, expected_number_simu = n, ..., general.spConform = FALSE,             RELAX = !missing(model) && is(model, "formula"))    else RFoptOld <- internal.rfoptions(xyz_notation = length(y) !=         0, expected_number_simu = n, ..., RELAX = !missing(model) &&         is(model, "formula"))    on.exit(RFoptions(LIST = RFoptOld[[1]]))    RFopt <- RFoptOld[[2]]    if (n > 2 && RFopt$internal$examples_reduced) {        message("number of simulations reduced")        n <- 2    }    cond.simu <- !missing(data) && !is.null(data)    reg <- RFopt$registers$register    mcall <- as.list(match.call(expand.dots = FALSE))    if (length(mcall) == 1 || length(mcall) == 2 && !is.null(mcall$n) ||         length(mcall) == 3 && !is.null(mcall$n) && "..." %in%             names(mcall)) {        if (cond.simu) {            stop("repeated performance of conditional simulation not programmed yet")        }        else {            res <- rfDoSimulate(n = n, reg = reg, spConform = RFopt$general$spConform)            if (RFopt$general$returncall)                 attr(res, "call") <- mc            attr(res, "coord_system") <- .Call(C_GetCoordSystem,                 reg, RFopt$coords$coord_system, RFopt$coords$new_coord_system)            return(res)        }    }    stopifnot(!missing(model) && !is.null(model))    model.orig <- model    model <- PrepareModel2(model, params = params, ...)    err.model <- if (missing(err.model))         NULL    else PrepareModel2(err.model, params = err.params, ...)    if (cond.simu) {        if (isSpObj(data))             data <- sp2RF(data)        stopifnot(missing(distances) || is.null(distances))        res <- switch(GetProcessType(model), RPgauss = rfCondGauss(model = model.orig,             x = x, y = y, z = z, T = T, grid = grid, n = n, data = data,             given = given, err.model = err.model, predict_register = MODEL_PREDICT,             ...), stop(GetProcessType(model), ": conditional simulation of the process not programmed yet"))    }    else {        if (!is.null(err.model))             warning("error model is unused in unconditional simulation")        warn.seed.not.na(RFoptOld)        if (exists(".Random.seed") && !is.na(RFopt$basic$seed)) {            .old.seed <- .Random.seed            on.exit(set.seed(.old.seed), add = TRUE)        }        rfInit(model = list("Simulate", setseed = eval(parse(text = "quote(set.seed(seed=seed))")),             env = .GlobalEnv, model), x = x, y = y, z = z, T = T,             grid = grid, distances = distances, dim = dim, reg = reg,             RFopt = RFopt, y.ok = FALSE)        if (n < 1)             return(NULL)        res <- rfDoSimulate(n = n, reg = reg, spConform = FALSE)    }    if ((!cond.simu || (!missing(x) && length(x) != 0)) && RFopt$general$spConform) {        info <- RFgetModelInfo(if (cond.simu)             MODEL_PREDICT        else reg, level = 3)        if (length(res) > 1e+07) {            message("Too big data set (more than 1e7 entries) to allow for 'spConform=TRUE'. So the data are returned as if 'spConform=FALSE'")            return(res)        }        prep <- prepare4RFspDataFrame(info, RFopt, x, y, z, T,             grid, coordnames = attributes(res)$coordnames)        attributes(res)$varnames <- attributes(res)$varnames        res <- conventional2RFspDataFrame(data = res, coords = prep$coords,             gridTopology = prep$gridTopology, n = n, vdim = info$vdim,             T = info$loc$T, vdim_close_together = RFopt$general$vdim_close_together)        if (is.raster(x)) {            res <- raster::raster(res)            raster::projection(res) <- raster::projection(x)        }    }    if (RFopt$general$returncall)         attr(res, "call") <- mc    attr(res, "coord_system") <- .Call(C_GetCoordSystem, as.integer(reg),         RFopt$coords$coord_system, RFopt$coords$new_coord_system)    return(res)})(model = new("RMmodel", call = RandomFields::RMmatern(nu = param["shape"],     var = param["variance"], Aniso = diag(1/c(param["scaleRandomFields"],         param["anisoRatio"] * param["scaleRandomFields"])) %*%         cbind(c(cos(param["anisoAngleRadians"]), sin(param["anisoAngleRadians"])),             c(-sin(param["anisoAngleRadians"]), cos(param["anisoAngleRadians"])))),     name = "RMmatern", submodels = list(), par.model = list(nu = c(shape = 2)),     par.general = list(var = c(variance = 4), Aniso = c(9.84807753012208,     0.434120444167326, -1.7364817766693, 2.46201938253052))),     x = c(0, 0.0101010101010101, 0.0202020202020202, 0.0303030303030303,     0.0404040404040404, 0.0505050505050505, 0.0606060606060606,     0.0707070707070707, 0.0808080808080808, 0.0909090909090909,     0.101010101010101, 0.111111111111111, 0.121212121212121,     0.131313131313131, 0.141414141414141, 0.151515151515152,     0.161616161616162, 0.171717171717172, 0.181818181818182,     0.191919191919192, 0.202020202020202, 0.212121212121212,     0.222222222222222, 0.232323232323232, 0.242424242424242,     0.252525252525253, 0.262626262626263, 0.272727272727273,     0.282828282828283, 0.292929292929293, 0.303030303030303,     0.313131313131313, 0.323232323232323, 0.333333333333333,     0.343434343434343, 0.353535353535354, 0.363636363636364,     0.373737373737374, 0.383838383838384, 0.393939393939394,     0.404040404040404, 0.414141414141414, 0.424242424242424,     0.434343434343434, 0.444444444444444, 0.454545454545455,     0.464646464646465, 0.474747474747475, 0.484848484848485,     0.494949494949495, 0.505050505050505, 0.515151515151515,     0.525252525252525, 0.535353535353535, 0.545454545454546,     0.555555555555556, 0.565656565656566, 0.575757575757576,     0.585858585858586, 0.595959595959596, 0.606060606060606,     0.616161616161616, 0.626262626262626, 0.636363636363636,     0.646464646464647, 0.656565656565657, 0.666666666666667,     0.676767676767677, 0.686868686868687, 0.696969696969697,     0.707070707070707, 0.717171717171717, 0.727272727272727,     0.737373737373737, 0.747474747474748, 0.757575757575758,     0.767676767676768, 0.777777777777778, 0.787878787878788,     0.797979797979798, 0.808080808080808, 0.818181818181818,     0.828282828282828, 0.838383838383838, 0.848484848484849,     0.858585858585859, 0.868686868686869, 0.878787878787879,     0.888888888888889, 0.898989898989899, 0.909090909090909,     0.919191919191919, 0.929292929292929, 0.939393939393939,     0.94949494949495, 0.95959595959596, 0.96969696969697, 0.97979797979798,     0.98989898989899, 1), y = c(0.896697200136259, 0.2655086631421,     0.37212389963679, 0.572853363351896, 0.908207789994776, 0.201681931037456,     0.898389684967697, 0.944675268605351, 0.660797792486846,     0.62911404389888, 0.0617862704675645, 0.205974574899301,     0.176556752528995, 0.687022846657783, 0.384103718213737,     0.769841419998556, 0.497699242085218, 0.717618508264422,     0.991906094830483, 0.380035179434344, 0.777445221319795,     0.934705231105909, 0.212142521282658, 0.651673766085878,     0.125555095961317, 0.267220668727532, 0.386114092543721,     0.0133903331588954, 0.382387957070023, 0.86969084572047,     0.34034899668768, 0.482080115471035, 0.599565825425088, 0.493541307048872,     0.186217601411045, 0.827373318606988, 0.668466738192365,     0.79423986072652, 0.107943625887856, 0.723710946040228, 0.411274429643527,     0.820946294115856, 0.647060193819925, 0.78293276228942, 0.553036311641335,     0.529719580197707, 0.789356231689453, 0.023331202333793,     0.477230065036565, 0.7323137386702, 0.692731556482613, 0.477619622135535,     0.8612094768323, 0.438097107224166, 0.244797277031466, 0.0706790471449494,     0.0994661601725966, 0.31627170718275, 0.518634263193235,     0.662005076417699, 0.406830187188461, 0.912875924259424,     0.293603372760117, 0.459065726259723, 0.332394674187526,     0.65087046707049, 0.258016780717298, 0.478545248275623, 0.766310670645908,     0.0842469143681228, 0.875321330036968, 0.339072937844321,     0.839440350187942, 0.34668348915875, 0.333774930797517, 0.476351245073602,     0.892198335845023, 0.864339470630512, 0.389989543473348,     0.777320698834956, 0.960617997217923, 0.434659484773874,     0.712514678714797, 0.399994368897751, 0.325352151878178,     0.757087148027495, 0.202692255144939, 0.711121222469956,     0.121691921027377, 0.245488513959572, 0.14330437942408, 0.239629415096715,     0.0589343772735447, 0.642288258532062, 0.876269212691113,     0.778914677444845, 0.79730882588774, 0.455274453619495, 0.410084082046524,     0.810870242770761), n = 1, spConform = TRUE, grid = FALSE)
   4: do.call(RandomFields::RFsimulate, theArgs)
   5: doTryCatch(return(expr), name, parentenv, handler)
   6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
   7: tryCatchList(expr, classes, parentenv, handlers)
   8: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call, nlines = 1L)        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        sm <- strsplit(conditionMessage(e), "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "Error : "    msg <- paste0(prefix, conditionMessage(e), "\n")    .Internal(seterrmessage(msg[1L]))    if (!silent && isTRUE(getOption("show.error.messages"))) {        cat(msg, file = outFile)        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
   9: try(do.call(RandomFields::RFsimulate, theArgs))
  10: RFsimulate(model, x, data = err.model, err.model = err.model,     n = n, ...)
  11: RFsimulate(model, x, data = err.model, err.model = err.model,     n = n, ...)
  12: eval(call, parent.frame())
  13: eval(call, parent.frame())
  14: callGeneric(model, x, data = err.model, err.model = err.model,     n = n, ...)
  15: geostatsp::RFsimulate(trueParamAniso, mydat)
  16: geostatsp::RFsimulate(trueParamAniso, mydat)
  An irrecoverable exception occurred. R is aborting now ...
Running the tests in ‘tests/simLgcp.R’ failed.
Complete output:
  > options("rgdal_show_exportToProj4_warnings"="none") 
  > library('geostatsp')
  Loading required package: Matrix
  Loading required package: raster
  Loading required package: sp
  > mymodel = c(mean=-1.5, variance=1, 
  + 				range=2, shape=2)
  > 
  > myraster = raster(nrows=15,ncols=15,xmn=0,xmx=10,ymn=0,ymx=10)
  > 
  > # some covariates, deliberately with a different resolution than myraster
  > covA = covB = myoffset = raster(extent(myraster), 10, 10)
  > values(covA) = as.vector(matrix(1:10, 10, 10))
  > values(covB) = as.vector(matrix(1:10, 10, 10, byrow=TRUE))
  > values(myoffset) = round(seq(-1, 1, len=ncell(myoffset)))
  > 
  > myCovariate = list(a=covA, b=covB, offsetFooBar = myoffset)
  > 
  > set.seed(0)
  > myLgcp=simLgcp(mymodel, myCovariate, 
  +     betas=c(a=-0.1, b=0.25), 
  + 	offset='offsetFooBar',
  + 	rasterTemplate=myraster)
  
   *** caught segfault ***
  address (nil), cause 'unknown'
  
  Traceback:
   1: RandomFieldsUtils::RFoptions()
   2: internal.rfoptions(xyz_notation = length(y) != 0, expected_number_simu = n,     ..., RELAX = !missing(model) && is(model, "formula"))
   3: (function (model, x, y = NULL, z = NULL, T = NULL, grid = NULL,     distances, dim, data, given = NULL, err.model, params, err.params,     n = 1, ...) {    if (!missing(model) && is(model, "RFfit"))         stop("To continue with the output of 'RFfit' use 'predict' or give the components separately")    mc <- as.character(deparse(match.call()))    if (!missing(distances) && length(distances) > 0)         RFoptOld <- internal.rfoptions(xyz_notation = length(y) !=             0, expected_number_simu = n, ..., general.spConform = FALSE,             RELAX = !missing(model) && is(model, "formula"))    else RFoptOld <- internal.rfoptions(xyz_notation = length(y) !=         0, expected_number_simu = n, ..., RELAX = !missing(model) &&         is(model, "formula"))    on.exit(RFoptions(LIST = RFoptOld[[1]]))    RFopt <- RFoptOld[[2]]    if (n > 2 && RFopt$internal$examples_reduced) {        message("number of simulations reduced")        n <- 2    }    cond.simu <- !missing(data) && !is.null(data)    reg <- RFopt$registers$register    mcall <- as.list(match.call(expand.dots = FALSE))    if (length(mcall) == 1 || length(mcall) == 2 && !is.null(mcall$n) ||         length(mcall) == 3 && !is.null(mcall$n) && "..." %in%             names(mcall)) {        if (cond.simu) {            stop("repeated performance of conditional simulation not programmed yet")        }        else {            res <- rfDoSimulate(n = n, reg = reg, spConform = RFopt$general$spConform)            if (RFopt$general$returncall)                 attr(res, "call") <- mc            attr(res, "coord_system") <- .Call(C_GetCoordSystem,                 reg, RFopt$coords$coord_system, RFopt$coords$new_coord_system)            return(res)        }    }    stopifnot(!missing(model) && !is.null(model))    model.orig <- model    model <- PrepareModel2(model, params = params, ...)    err.model <- if (missing(err.model))         NULL    else PrepareModel2(err.model, params = err.params, ...)    if (cond.simu) {        if (isSpObj(data))             data <- sp2RF(data)        stopifnot(missing(distances) || is.null(distances))        res <- switch(GetProcessType(model), RPgauss = rfCondGauss(model = model.orig,             x = x, y = y, z = z, T = T, grid = grid, n = n, data = data,             given = given, err.model = err.model, predict_register = MODEL_PREDICT,             ...), stop(GetProcessType(model), ": conditional simulation of the process not programmed yet"))    }    else {        if (!is.null(err.model))             warning("error model is unused in unconditional simulation")        warn.seed.not.na(RFoptOld)        if (exists(".Random.seed") && !is.na(RFopt$basic$seed)) {            .old.seed <- .Random.seed            on.exit(set.seed(.old.seed), add = TRUE)        }        rfInit(model = list("Simulate", setseed = eval(parse(text = "quote(set.seed(seed=seed))")),             env = .GlobalEnv, model), x = x, y = y, z = z, T = T,             grid = grid, distances = distances, dim = dim, reg = reg,             RFopt = RFopt, y.ok = FALSE)        if (n < 1)             return(NULL)        res <- rfDoSimulate(n = n, reg = reg, spConform = FALSE)    }    if ((!cond.simu || (!missing(x) && length(x) != 0)) && RFopt$general$spConform) {        info <- RFgetModelInfo(if (cond.simu)             MODEL_PREDICT        else reg, level = 3)        if (length(res) > 1e+07) {            message("Too big data set (more than 1e7 entries) to allow for 'spConform=TRUE'. So the data are returned as if 'spConform=FALSE'")            return(res)        }        prep <- prepare4RFspDataFrame(info, RFopt, x, y, z, T,             grid, coordnames = attributes(res)$coordnames)        attributes(res)$varnames <- attributes(res)$varnames        res <- conventional2RFspDataFrame(data = res, coords = prep$coords,             gridTopology = prep$gridTopology, n = n, vdim = info$vdim,             T = info$loc$T, vdim_close_together = RFopt$general$vdim_close_together)        if (is.raster(x)) {            res <- raster::raster(res)            raster::projection(res) <- raster::projection(x)        }    }    if (RFopt$general$returncall)         attr(res, "call") <- mc    attr(res, "coord_system") <- .Call(C_GetCoordSystem, as.integer(reg),         RFopt$coords$coord_system, RFopt$coords$new_coord_system)    return(res)})(x = new("GridTopology", cellcentre.offset = c(s1 = 0.333333333333333, s2 = 0.333333333333333), cellsize = c(0.666666666666667, 0.666666666666667), cells.dim = c(15L, 15L)), model = new("RMmodel", call = RandomFields::RMmatern(nu = param["shape"],     var = param["variance"], scale = param["scaleRandomFields"]),     name = "RMmatern", submodels = list(), par.model = list(nu = c(shape = 2)),     par.general = list(var = c(variance = 1), scale = c(scaleRandomFields = 1))),     n = 1, spConform = TRUE)
   4: do.call(RandomFields::RFsimulate, theArgs)
   5: RFsimulate(model, x, data = data, err.model = err.model, n = n,     ...)
   6: RFsimulate(model, x, data = data, err.model = err.model, n = n,     ...)
   7: eval(call, parent.frame())
   8: eval(call, parent.frame())
   9: callGeneric(model, x, data = data, err.model = err.model, n = n,     ...)
  10: RFsimulate(model = model, x = x, data = data, err.model = err.model,     n = n, ...)
  11: RFsimulate(model = model, x = x, data = data, err.model = err.model,     n = n, ...)
  12: eval(call, parent.frame())
  13: eval(call, parent.frame())
  14: callGeneric(model = model, x = x, data = data, err.model = err.model,     n = n, ...)
  15: RFsimulate(model = param, x = rasterTemplate, n = n, ...)
  16: RFsimulate(model = param, x = rasterTemplate, n = n, ...)
  17: simLgcp(mymodel, myCovariate, betas = c(a = -0.1, b = 0.25),     offset = "offsetFooBar", rasterTemplate = myraster)
  An irrecoverable exception occurred. R is aborting now ...