This vignette lists the steps required to use patter
to
reconstruct movements and patterns of space use. Use it as a reference.
See package documentation, such as the README, for
streamlined example workflow(s). See the patter-flapper
project for a complete, real-world analysis.
Load the patter
package via
library(patter)
.
Connect to Julia
via
julia_connect()
.
Set the seed in R
and Julia
via
set_seed()
.
Define a terra::SpatRaster
map of the study
area:
SpatRaster
(see ?dat_gebco
and ?glossary
);NA
s;Julia
via
set_map()
;Define the State
type:
State
defines the components of the animal’s movement
that you want to track;x
and y
locations, use StateXY
;Define a corresponding movement model (ModelMove
)
instance:
?ModelMove
for built-in options and instructions
for custom sub-types;Define observational datasets:
patter
should be able to work with any kind of
observational dataset;datasets-mefs
for example datasets included in the
package;Validate datasets:
patter
require manual preparation for
analysis;?glatos::false_detections()
);patter
provides a pat_setup_data()
function
which validates data format of these data types for use in
patter
;Define observation models (ModelObs
) sub-types:
?ModelObs
for built-in observation models and
instructions for custom sub-types;Collate observations and observation model parameters:
data.table
s in
long-format;pat_setup_data()
and assemble_*()
functions to
assemble datasets as required;assemble_*()
function documentation
for straightforward dataset assembly instructions;To simulate datasets instead, see sim_*()
functions;
pf_filter()
:
list
, which includes a
states
data.table
that defines the possible
states (locations) of the individual at each time step (according to the
movement model and the observations);Implement the particle filter forwards and backwards;
Implement the two-filter smoother via
pf_smoother_two_filter()
:
Plot particle positions via pf_plot_*()
;
Map utilisation distributions:
map_pou()
;map_dens()
;Map home ranges via map_hr_*()
;