inla.simplify.curve.Rd since
23.08.18.
Use fmesher::fm_simplify_helper()
instead.
Attempts to simplify a polygonal curve by joining nearly colinear segments.
Uses a variation of the binary splitting Ramer-Douglas-Peucker algorithm,
with a width eps ellipse instead of a rectangle, motivated by
prediction ellipse for Brownian bridge.
inla.simplify.curve(loc, idx, eps)An index vector into loc specifying the simplified polygonal
curve.
theta <- seq(0, 2 * pi, length.out = 1000)
loc <- cbind(cos(theta), sin(theta))
idx <- inla.simplify.curve(loc = loc, idx = 1:nrow(loc), eps = 0.01)
#> Warning: `inla.simplify.curve()` was deprecated in INLA 23.08.18.
#> ℹ Please use `fmesher::fm_simplify_helper()` instead.
#> ℹ For more information, see
#> https://inlabru-org.github.io/fmesher/articles/inla_conversion.html
#> ℹ To silence these deprecation messages in old legacy code, set
#> `inla.setOption(fmesher.evolution.warn = FALSE)`.
#> ℹ To ensure visibility of these messages in package tests, also set
#> `inla.setOption(fmesher.evolution.verbosity = 'warn')`.
print(c(nrow(loc), length(idx)))
#> [1] 1000 33
plot(loc, type = "l")
lines(loc[idx, ], col = "red")