join() joins ssm-predicted locations and mpm-estimated behavioural index into a single tibble. If the ssm-predicted tibble is a projected sf object then the output of join will also be an sf object (default). This can be avoided by using as_sf = FALSE.
join(
ssm,
mpm,
what.ssm = "predicted",
as_sf = FALSE,
normalise = FALSE,
group = FALSE
)an aniMotum ssm fitted model object
an aniMotum mpm fitted model object
specifies whether ssm predicted or fitted values are to be extracted
logical; if FALSE then return a tibble with un-projected lonlat coordinates, otherwise return an sf tibble
logical; if output includes a move persistence estimate, should g (the move persistence index) be normalised to have minimum = 0 and maximum = 1 (default = FALSE).
logical; should g be normalised among individuals as a group, a 'relative g', or separately to highlight regions of lowest and highest move persistence along a track (default = FALSE).
a single tbl with all individuals
## load example aniMotum fit objects (to save time)
## generate a ssm fit object
xs <- fit_ssm(ellie, spdf=FALSE, model = "rw", time.step=24, control = ssm_control(verbose = 0))
#>
xm <- fit_mpm(xs, what = "p", model = "mpm")
#> fitting mpm...
#>
pars: 0 0 0
pars: -0.65941 -0.75117 -0.0305
pars: -2.63762 -3.00467 -0.12198
pars: -2.73902 -4.15709 -0.30416
pars: -0.86737 -1.09176 -0.05786
pars: -1.18958 -1.82082 -0.12605
pars: -0.85254 -2.5293 -0.28245
pars: -1.13956 -1.92596 -0.14926
pars: -1.14036 -1.98787 -0.25055
pars: -1.1294 -1.93096 -0.35416
pars: -1.12879 -1.95617 -0.47017
pars: -1.12277 -1.93611 -0.70668
pars: -1.10627 -1.88115 -1.35488
pars: -1.00803 -1.90485 -1.72889
pars: -1.08402 -1.90475 -1.43978
pars: -1.16518 -1.94341 -1.4532
pars: -1.10467 -1.91459 -1.4432
pars: -1.10587 -1.91614 -1.46624
pars: -1.10948 -1.92078 -1.53536
pars: -1.10046 -1.90954 -1.7198
pars: -1.1023 -1.91217 -1.7172
pars: -1.1023 -1.91217 -1.7172
## join predicted values as an un-projected tibble
xsm <- join(xs, xm)
xsm
#> # A tibble: 113 × 12
#> id date lon lat x y x.se y.se gap_flag
#> <chr> <dttm> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <int>
#> 1 54591 2012-03-05 05:00:00 111. -66.4 12309. -9956. 1.38 1.44 0
#> 2 54591 2012-03-06 05:00:00 110. -66.4 12287. -9947. 25.2 0.413 0
#> 3 54591 2012-03-07 05:00:00 110. -66.5 12298. -9963. 4.49 2.40 0
#> 4 54591 2012-03-08 05:00:00 110. -66.4 12288. -9949. 32.8 28.0 0
#> 5 54591 2012-03-09 05:00:00 110. -66.5 12299. -9972. 9.04 2.50 0
#> 6 54591 2012-03-10 05:00:00 111. -66.4 12302. -9958. 21.4 18.1 0
#> 7 54591 2012-03-11 05:00:00 111. -66.5 12323. -9967. 22.4 19.1 0
#> 8 54591 2012-03-12 05:00:00 110. -66.5 12288. -9963. 28.0 9.60 0
#> 9 54591 2012-03-13 05:00:00 110. -66.4 12288. -9950. 35.5 30.3 0
#> 10 54591 2012-03-14 05:00:00 110. -66.4 12291. -9938. 32.9 28.1 0
#> # ℹ 103 more rows
#> # ℹ 3 more variables: logit_g <dbl>, logit_g.se <dbl>, g <dbl>