#tryCatch version
tryCatch({
if (requireNamespace("INLA", quietly = TRUE)) {
library(INLA)
set.seed(123)
loc <- matrix(runif(100 * 2) * 100, 100, 2)
mesh <- inla.mesh.2d(
loc = loc,
cutoff = 50,
max.edge = c(50, 500)
)
A <- rspde.make.A(mesh, loc = loc, rspde.order = 3)
}
#stable.tryCatch
}, error = function(e){print("Could not run the example")})
Run the code above in your browser using DataLab