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
)

Arguments

ssm

an aniMotum ssm fitted model object

mpm

an aniMotum mpm fitted model object

what.ssm

specifies whether ssm predicted or fitted values are to be extracted

as_sf

logical; if FALSE then return a tibble with un-projected lonlat coordinates, otherwise return an sf tibble

normalise

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).

group

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).

Value

a single tbl with all individuals

Examples

## 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.65944 -0.75114 -0.03049      
 pars:   -2.63775 -3.00457 -0.12194      
 pars:   -2.73937 -4.15687 -0.30416      
 pars:   -0.86743 -1.09171 -0.05785      
 pars:   -1.18976 -1.82073 -0.12602      
 pars:   -0.8491 -2.52724 -0.28347      
 pars:   -1.13954 -1.92487 -0.14923      
 pars:   -1.13979 -1.98651 -0.24977      
 pars:   -1.12989 -1.92935 -0.35244      
 pars:   -1.12789 -1.95509 -0.46751      
 pars:   -1.12669 -1.93037 -0.58281      
 pars:   -1.12848 -1.92558 -0.81238      
 pars:   -1.12944 -1.87726 -1.377      
 pars:   -0.809 -1.84174 -2.25192      
 pars:   -1.0756 -1.9101 -1.45917      
 pars:   -1.1263 -1.96239 -1.53282      
 pars:   -1.1094 -1.91349 -1.46293      
 pars:   -1.1047 -1.90968 -1.49657      
 pars:   -1.10821 -1.90297 -1.55182      
 pars:   -1.1032 -1.91244 -1.6407      
 pars:   -1.10231 -1.91103 -1.70906      
 pars:   -1.10231 -1.91103 -1.70906      

## join predicted values as an un-projected tibble
xsm <- join(xs, xm)
xsm
#> # A tibble: 113 × 11
#>    id    date                  lon   lat      x      y  x.se   y.se logit_g
#>    <chr> <dttm>              <dbl> <dbl>  <dbl>  <dbl> <dbl>  <dbl>   <dbl>
#>  1 54591 2012-03-05 05:00:00  111. -66.4 12309. -9956.  1.38  1.44    0.103
#>  2 54591 2012-03-06 05:00:00  110. -66.4 12287. -9947. 25.6   0.419   0.103
#>  3 54591 2012-03-07 05:00:00  110. -66.5 12298. -9963.  4.48  2.47    0.103
#>  4 54591 2012-03-08 05:00:00  110. -66.4 12288. -9949. 32.7  28.8     0.107
#>  5 54591 2012-03-09 05:00:00  110. -66.5 12299. -9972.  9.07  2.55    0.114
#>  6 54591 2012-03-10 05:00:00  111. -66.4 12302. -9958. 21.3  18.6     0.123
#>  7 54591 2012-03-11 05:00:00  111. -66.5 12323. -9967. 22.3  19.6     0.136
#>  8 54591 2012-03-12 05:00:00  110. -66.5 12287. -9962. 28.2   9.78    0.149
#>  9 54591 2012-03-13 05:00:00  110. -66.4 12288. -9950. 35.4  31.1     0.168
#> 10 54591 2012-03-14 05:00:00  110. -66.4 12291. -9938. 32.8  28.9     0.192
#> # ℹ 103 more rows
#> # ℹ 2 more variables: logit_g.se <dbl>, g <dbl>