route_path | R Documentation |
pathroutr
packageA wrapper function that uses the pathroutr
package
https://jmlondon.github.io/pathroutr/
to re-route movement paths that cross a land barrier. The current
implementation will take either the output from a fit_ssm
model or the
simulations generated by sim_fit
.
route_path(
x,
what = c("fitted", "predicted"),
map_scale = 50,
dist = 50000,
append = TRUE,
...
)
x |
either a |
what |
if using a |
map_scale |
scale of rnaturalearth map to use for land mass: one of 110,
50 (default), or 10. Note that map_scale = 10 is only available if you have
the |
dist |
buffer distance (m) to add around track locations. The convex hull of these buffered locations defines the size of land polygon used to aid re-routing of points on land. Larger buffers can result in longer computation times. See London (2020) for further details. The default buffer distance is a constant 50000 m. |
append |
should re-routed locations be appended to the |
... |
additional arguments passed to pathroutr::prt_visgraph |
route_path
uses rnaturalearth::ne_countries at the medium (50)
scale, by default, to generate a land barrier. For efficient computation,
route_path
clips the polygons to the buffered bounds (set by dist
(in m)
of the movement track(s).
When the input is a ssm
object route_path
can append the
re-routed path locations to the ssm
(ssm fit) object. This is useful
when move persistence is to be estimated from the re-routed locations via
fit_mpm
, or tracks are to be visualised with map
. route_path
can also
return a standalone tibble
of the re-routed path with the same number of
locations as either the original fitted or predicted locations.
When the re-routed path is appended to the ssm
object, the path can be
extracted using the grab
function, e.g. grab(fit, what = "rerouted")
.
When the input is a sim_fit
object then route_path
returns the same
object but with the locations within each simulation re-routed.
We recommend that users working on complex rerouting problems and/or
requiring higher resolution land barrier data work with the pathroutr
package directly by first exctracting aniMotum-estimated locations with
grab
. Higher resolution land barrier data (polygon shapefiles) must be
obtained independently.
Josh M. London. (2020) pathroutr: An R Package for (Re-)Routing Paths Around Barriers (Version v0.2.1) https://zenodo.org/record/5522909#.YnPxEy_b1qs
# if 'pathroutr' is installed then ok to use route_path()
if(requireNamespace("pathroutr", quietly = TRUE)) {
fit <- fit_ssm(ellie, vmax = 4, model = "crw", time.step = 24)
fit <- route_path(fit, what = "predicted")
grab(fit, what = "rerouted")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.