PhysMove includes two metrics for identifying space-use patterns that are based on four functions, including:
infomapCommunities() and
communityMap()occupancy() and plotPDF()Interactions between species’ movements and space-use can be
described using a network analysis algorithm called Infomap, which
identifies communities where animals follow similar movement patterns
and remain for extended periods. To identify Infomap communities,
PhysMove requires the infomapecology R
package, the emln R package,
and a stand-alone Infomap
file.
Installation instructions for both packages and the Infomap
file are available here: http://infomapecology.ecomplab.com/installation. Further
details can be found in Farage et al. (2021). The
following instructions assume both the infomapecology and
emln R packages and the stand-alone Infomap file have been
installed.
The infomapCommunities() function identifies
community-wide movements in two steps. First,
infomapCommunities() calculates the probability of
individuals moving between specific grid cells along their track within
a predetermined time window. This step creates a transition probability
matrix (tpm), which can also be referred to as a “unipartite edge list”.
Next, infomapCommunities() feeds the transition probability
matrix into functions from the emln and
infomapecology R packages to create an Infomap
monolayer object that identifies movement communities.
To ensure the infomapecology algorithm calculates
movement patterns consistent with telemetry data, we assign parameters
to the infomapecology function that allow for directed
movement, self-links (i.e., individuals can remain in the same grid cell
over time), and hierarchical partitioning (i.e., resulting communities
can be composed of multiple levels). Because we allowed hierarchical
partitioning, the resulting communities are associated with different
levels. Level 1 communities are the most inclusive and have been used to
identify community-wide movements (following Rodríguez et
al. 2017 and Calich et al. 2021).
The infomapCommunities() function requires a data frame
with telemetry data (see data formatting) and
includes five optional parameters:
gridCell: grid cell size in degrees
(gridCell=0.25, by default),hours: number of hours between location estimates
(hours=24, by default),range_hr: time range in hours (range_hr=6,
by default). This parameter allows you to identify location estimates
that are close to, but not exactly separated by the set number of
hours, andtpm: save the transition probability matrix to the
output list as a second list element (tpm=FALSE, by
default).infomapCommunities() outputs a list with up to two list
objects. The first list object is an infomap monolayer object
that summarizes the hierarchical structure of the Infomap communities
(regions where individuals follow similar movement patterns and are
likely to stay for longer periods of time). The second list object is
the transition probability matrix, which is only output if
tpm=TRUE.
Important: Before running
infomapCommunities() you must:
Set your working directory to the folder that contains the
stand-alone Infomap file using setwd()
Load the infomapecology R package using
library(infomapecology)
# View the Infomap monolayer object structure
str(infomapResult[["infomap_object"]])
#> List of 8
#> $ call : chr "./infomap infomap.txt . --tree --seed 123 -N 100 -f directed --silent"
#> $ L : num 2.3
#> $ m : num 4
#> $ modules : tibble [494 × 14] (S3: tbl_df/tbl/data.frame)
#> ..$ node_id : num [1:494] 1 2 3 4 5 6 7 8 9 10 ...
#> ..$ node_name : chr [1:494] "Node1" "Node2" "Node3" "Node4" ...
#> ..$ flow : num [1:494] 0.000439 0.00222 0.00276 0.000209 0.001588 ...
#> ..$ levels : num [1:494] 3 3 3 3 3 3 3 3 3 3 ...
#> ..$ module_level1: num [1:494] 3 3 3 3 3 3 3 3 3 3 ...
#> ..$ module_level2: num [1:494] 7 7 7 5 5 5 7 5 7 5 ...
#> ..$ module_level3: num [1:494] 3 3 1 5 5 3 1 1 2 1 ...
#> ..$ module_level4: num [1:494] 2 1 1 2 1 1 2 1 1 3 ...
#> ..$ module_level5: num [1:494] NA NA NA NA NA NA NA NA NA NA ...
#> ..$ module_level6: num [1:494] NA NA NA NA NA NA NA NA NA NA ...
#> ..$ module_level7: num [1:494] NA NA NA NA NA NA NA NA NA NA ...
#> ..$ cell : num [1:494] 496083 497523 498963 497524 497525 ...
#> ..$ long : num [1:494] 0.625 0.625 0.625 0.875 1.125 ...
#> ..$ lat : num [1:494] -3.88 -3.62 -3.38 -3.62 -3.62 ...
#> $ edge_list:'data.frame': 2298 obs. of 3 variables:
#> ..$ from : chr [1:2298] "Node2" "Node1" "Node2" "Node12" ...
#> ..$ to : chr [1:2298] "Node1" "Node2" "Node2" "Node2" ...
#> ..$ weight: num [1:2298] 0.2 1 0.6 0.125 0.1 ...
#> $ L_sim : NULL
#> $ m_sim : NULL
#> $ pvalue : NULL
#> - attr(*, "class")= chr "infomap_monolayer"communityMap() visualises results from
infomapCommunities() by converting the Infomap
monolayer object into a map (Figure V13).
The communityMap() function requires the full output
list from infomapCommunities(), from which Infomap
monolayer object is extracted internally, and includes two optional
parameters:
subset_communities: used to only map specific level 1
communities. For example, subset_communities = c(1,2,3)
would plot the first three level 1 communities (all communities are
included by default), andcolours: change colours of the communities
(colours= "Dark2", by default).
Figure V13 Map illustrating level 1 Infomap communities
from the
'tracks' dataset determined using
infomapCommunities() default parameters. Map created with
communityMap() default parameters.
The occupancy() function helps describe species’
space-use patterns by calculating the total number of location estimates
within each grid cell divided by the grid cell’s area, calculated using
spherical coordinates (Figure V14).
occupancy() requires a data frame with telemetry data
(see data
formatting) and includes three optional parameters:
gridCell: change the grid cell size in degrees
(gridCell=0.25, by default),map: present results in a map (map=TRUE,
by default) andcolGrad: edit the colours used in the map to indicate
low, moderate, and high occupancy, respectively, which are visualised
using scale_fill_gradientn() from the ggplot2 package (Wickham 2016)
(colGrad=c("blue", "light blue", "red"), by default).occupancy() outputs a data frame of all results,
including:
Figure V14 Map of occupancy patterns from the
'tracks' dataset. Map created with occupancy()
default parameters.
# Summarize occupancy results
summary(occ)
#> Latitude Longitude Area Counts
#> Min. :-3.8750 Min. :-2.625 Min. :771.0 Min. : 1.00
#> 1st Qu.:-1.3750 1st Qu.: 0.625 1st Qu.:772.2 1st Qu.: 8.00
#> Median : 0.0000 Median : 1.625 Median :772.5 Median : 20.00
#> Mean : 0.0754 Mean : 1.743 Mean :772.4 Mean : 31.63
#> 3rd Qu.: 1.3750 3rd Qu.: 3.125 3rd Qu.:772.7 3rd Qu.: 41.75
#> Max. : 3.8750 Max. : 5.625 Max. :772.8 Max. :223.00
#> Occupancy
#> Min. :0.001294
#> 1st Qu.:0.010357
#> Median :0.025906
#> Mean :0.040936
#> 3rd Qu.:0.054041
#> Max. :0.288579A pdf of the results from occupancy() can be plotted
with the plotPDF() function when the desc
parameter is set to “occupancy” (Figure V15).
Figure V15 Probability density function (pdf) plot of
occupancy values for the tracks dataset calculated with
occupancy() default parameters. Plot created using
plotPDF() with desc="occupancy".
Burnham, K.P. & Anderson, D.R. (2004) Multimodel Inference: Understanding AIC and BIC in Model Selection. Sociological Methods & Research, 33, 261-304.
Calich, H.J. et al. (2021) Comprehensive analytical approaches reveal species-specific search strategies in sympatric apex predatory sharks. Ecography, 44, 1544-1556.
Farage, C. et al. (2021) Identifying flow modules in ecological networks using Infomap. Methods in Ecology and Evolution, 12, 778–786.
Méndez, V., et al. (2013). Stochastic Foundations in Movement Ecology: Anomalous Diffusion, Front Propagation and Random Searches. Berlin, Heidelberg, Germany, Springer Berlin / Heidelberg.
Rodríguez, J.P. et al. (2017) Big data analyses reveal patterns and drivers of the movements of southern elephant seals. Scientific Reports, 7, 1-10.
Viswanathan, G. M., et al. (2011). The Physics of Foraging: An Introduction to Biological Encounters and Random Searches. Cambridge, Cambridge University Press.
Wickham, H. (2016) ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag, New York.