From e960d1e68069e7a0e370d0e612c78097d9fb53e5 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Tue, 10 Oct 2023 18:39:02 -0700 Subject: [PATCH] Revert to inla.spde2.matern --- R/mesh.R | 10 +++++----- man/make_mesh.Rd | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/R/mesh.R b/R/mesh.R index e2ad794c0..11929d2c3 100644 --- a/R/mesh.R +++ b/R/mesh.R @@ -25,8 +25,7 @@ #' #' @export #' -#' @examples -#' +#' @examplesIf inla_installed() #' \donttest{ #' mesh <- make_mesh(pcod, c("X", "Y"), cutoff = 5, type = "cutoff") #' plot(mesh) @@ -38,6 +37,7 @@ #' plot(mesh) #' #'} +#' # # Defining a mesh directly with fmesher (formerly in INLA): # bnd <- fmesher::fm_nonconvex_hull(cbind(pcod$X, pcod$Y), convex = -0.05) # inla_mesh <- fmesher::fm_mesh_2d_inla( @@ -128,11 +128,11 @@ make_mesh <- function(data, xy_cols, loc_centers <- NA } # TODO: - # spde <- INLA::inla.spde2.matern(mesh) - # mesh_inla <- INLA::inla.mesh.create(loc_xy, refine = TRUE, cutoff = cutoff) + spde <- INLA::inla.spde2.matern(mesh) + mesh_inla <- INLA::inla.mesh.create(loc_xy, refine = TRUE, cutoff = cutoff) # names(spde_inla$param.inla) - spde <- fmesher::fm_matern_precision(mesh, alpha = 2) + # spde <- fmesher::fm_matern_precision(mesh, alpha = 2, rho = ) # A_inla <- INLA::inla.spde.make.A(mesh, loc = loc_xy) A <- fmesher::fm_basis(mesh, loc = loc_xy) diff --git a/man/make_mesh.Rd b/man/make_mesh.Rd index 6d2709f4b..5ed2505b8 100644 --- a/man/make_mesh.Rd +++ b/man/make_mesh.Rd @@ -60,7 +60,7 @@ pass \code{your_mesh$mesh} to \code{\link[inlabru:gg]{inlabru::gg()}}. Construct an SPDE mesh for use with sdmTMB. } \examples{ - +\dontshow{if (inla_installed()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \donttest{ mesh <- make_mesh(pcod, c("X", "Y"), cutoff = 5, type = "cutoff") plot(mesh) @@ -72,4 +72,5 @@ mesh <- make_mesh(pcod, c("X", "Y"), n_knots = 50, type = "kmeans") plot(mesh) } +\dontshow{\}) # examplesIf} }