Running examples in ‘geostatsp-Ex.R’ failed
The error most likely occurred in:

> ### Name: RFsimulate
> ### Title: Simulation of Random Fields
> ### Aliases: RFsimulate modelRandomFields RFsimulate RFsimulate-methods
> ###   RFsimulate,ANY,Raster-method RFsimulate,numeric,SpatialGrid-method
> ###   RFsimulate,numeric,SpatialPixels-method
> ###   RFsimulate,numeric,SpatialPoints-method
> ###   RFsimulate,numeric,GridTopology-method
> ###   RFsimulate,RMmodel,GridTopology-method
> ###   RFsimulate,RMmodel,SpatialPoints-method
> ###   RFsimulate,matrix,Raster-method RFsimulate,matrix,Spatial-method
> ###   RFsimulate,data.frame,ANY-method
> ### Keywords: spatial
> 
> ### ** Examples
> 
> library('geostatsp')
> model1 <- c(var=5, range=1,shape=0.5)
> 
> 
> myraster = raster(nrows=20,ncols=30,xmn=0,ymn=0,xmx=6,ymx=4, 
+ 	crs=CRS("+proj=utm +zone=17 +datum=NAD27 +units=m +no_defs"))
> 
> set.seed(0) 
> 
> simu <- RFsimulate(model1, 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 = 0.1, s2 = 0.1), cellsize = c(0.2, 0.2), cells.dim = c(30L, 20L)), 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.5)),     par.general = list(var = c(variance = 5), scale = c(scaleRandomFields = 0.5))),     n = 3, 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(model1, x = myraster, n = 3)
16: RFsimulate(model1, x = myraster, n = 3)
An irrecoverable exception occurred. R is aborting now ...