Nothing
library("geostatsp")
data("loaloa")
loaloa = unwrap(loaloa)
elevationLoa = unwrap(elevationLoa)
eviLoa = unwrap(eviLoa)
pts = geostatData(
y ~ elev + evi,
data = loaloa,
covariates = list(elev = elevationLoa, evi = eviLoa),
grid = squareRaster(loaloa, cells = 20, buffer = 1e4)
)
stopifnot(identical(names(pts), c("data", "grid", "covariates")))
stopifnot(inherits(pts$data, "SpatVector"))
stopifnot(inherits(pts$grid, "SpatRaster"))
stopifnot(all(c("elev", "evi") %in% names(pts$data)))
stopifnot(all(c("elev", "evi") %in% names(pts$covariates)))
stopifnot(identical(
as.character(geostatsp:::allVarsP(
y ~ elev + INLA::f(villageID, prior = "pc.prec",
param = c(1, 0.5), model = "iid"))),
as.character(geostatsp:::allVarsP(
y ~ elev + f(villageID, prior = "pc.prec",
param = c(1, 0.5), model = "iid")))
))
ptsNs = geostatData(
y ~ elev + evi +
INLA::f(villageID, prior = "pc.prec", param = c(1, 0.5),
model = "iid"),
data = loaloa,
covariates = list(elev = elevationLoa, evi = eviLoa),
grid = squareRaster(loaloa, cells = 20, buffer = 1e4)
)
stopifnot(all(c("elev", "evi", "villageID") %in% names(ptsNs$data)))
stopifnot(!("INLA" %in% names(ptsNs$data)))
myCrs = crs("+proj=utm +zone=17 +ellps=GRS80 +units=m +no_defs")
dataR = rast(matrix(1:100, 10, 10), extent = ext(0, 1000, 0, 1000), crs = myCrs)
names(dataR) = "y"
covR = rast(matrix(seq_len(100), 10, 10), extent = ext(0, 1000, 0, 1000), crs = myCrs)
names(covR) = "x"
ras = geostatData(
y ~ x,
data = dataR,
covariates = covR
)
stopifnot(identical(names(ras), c("data", "grid", "covariates", "formula")))
stopifnot(inherits(ras$grid, "SpatRaster"))
stopifnot("x" %in% names(ras$data))
stopifnot("x" %in% names(ras$covariates))
ok = try(
geostatData(y ~ x, data = data.frame(y = 1, x = 2)),
silent = TRUE
)
stopifnot(inherits(ok, "try-error"))
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.