Analysing data from bat observations along transects

bats
analysis
Author

Thierry Onkelinx

Published

July 2, 2017

This post will handle observations of bats along a set of transects. It is a work in progress simply because I’m still collecting more data. So come back once and awhile to see potential updates.

The survey

The principle of the survey is quite simple: walk around with a bat detector and note the route you took and were you encounter bats. Repeat this several times. I choose to take a different route each time so I can cover the same area at different times of night.

I use ObsMapp to trace the route and the observations. The bat detector is a Peersonic RPA2 with Philips SHB9850NC headphones. This set-up is quite handy. At the start of the route you start listening to the bat detector and tell ObsMapp to start tracking the route. Each time you encounter a bat you a) make a sound recording of the bat and b) mark the observation in ObsMapp1. At home you upload the observations to waarnemingen.be, waarneming.nl or observation.org. Then you check the observations based on the recorded sounds and update the observations on the website. Each survey is downloadable from the website under several formats. Here we will use both the KML format and the csv format. The KML is required because it contains both the track of each route and the observations. The csv is needed for the date, the start time and end time of the track.

Survey effort

waarnemingen.be has unfortunately no API to download our data. We had to download every track manually as a KML file. Then we parse those files to get the observations and the tracks. The code to parse the files is available in the source code of the blog. The result is the set of all tracks and observations (Figure 1).

Figure 1: Map with all tracks and all observations.

We determine the survey effort as the cumulative proportion on the area of grid cells that a covered by a survey. So we start by defining a grid with 100x100m resolution. Then we create of buffer on 20m around the tracks because assume that we can here most bats up to this distance on the bat detector. The result is a ribbon marking the area where we could have detected bats. The total area of ribbon per grid cell is an indicator of the total survey effort per grid cell (Figure 2).

Figure 2: Map with total survey effort.

Presence of bats

The number of observations per species is quite different. Only the common pipistrelle (Pipistrellus pipistrellus) has currently enough observations for the analysis (Table 1). Note that the table also contains other mammal species because I note all mammal species that I encounter.

Table 1: Number of observations per species and per track
species 2017-06-04 2017-06-10 2017-06-19 2017-06-29
Pipistrellus pipistrellus 51 39 14 28
Erinaceus europaeus 0 2 0 0
Martes foina 0 0 1 1
Myotis mystacinus 2 0 0 0
Oryctolagus cuniculus 1 0 0 0
Pipistrellus spec 0 0 1 0
Vulpes vulpes 1 0 0 0

Next we check for each combination of track and grid cell whether we detected pipistrelles or not. Figure 3 displays the average presence over all tracks.

Figure 3: Map with presence of common pipistrelle.

Figure 4 show the distance from the centre of each grid cell to the centre of the nearest other grid cell were we detected common pipistrelle during the entire study. This can given an indication of clustering or repulsion.

Figure 4: Map with nearest neighbour distance of common pipistrelle.

Exploratory data analysis

The current analysis used only very basic variables: survey effort (Figure 5) and nearest neighbour distance (Figure 6).

Figure 5: Dection of common pipistrelle in terms of survey effort.

Figure 6: Dection of common pipistrelle in terms of distance to nearest neighbouring grid cell were common pipistrelle was observed. A small jitter was added due to heavy overlap between points.

Modelling

Figure 7 show the median predicted probability for common pipistrelle. This is an estimation of the change to encounter common pipistrelles in each grid cell. The lower credible limit of these prediction are useful to detect the important locations (Figure 8). The higher the lower credible limit, the more certain the model is about the presence of common pipistrelles. Likewise, the upper credible limit (Figure 9) is useful to detect locations where the model is more certain about the absence of common pipistrelle.

Figure 7: Median of predicted probability for common pipistrelle assuming fully surveyed grid cells.
Figure 8: Lower credible interval of predicted probability for common pipistrelle assuming fully surveyed grid cells.
Figure 9: Upper credible interval of predicted probability for common pipistrelle assuming fully surveyed grid cells.

The receiver operating characteristic (ROC, Figure 10) gives an indication of the quality of the model. It can be summarised by the area under the curve (AUC). The closer the AUC value get to 1, the better the model.

Figure 10: Receiver operating curve.

Session info

─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.1 (2023-06-16)
 os       Ubuntu 22.04.3 LTS
 system   x86_64, linux-gnu
 ui       X11
 language nl_BE:nl
 collate  nl_BE.UTF-8
 ctype    nl_BE.UTF-8
 tz       Europe/Brussels
 date     2023-08-30
 pandoc   3.1.1 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
 package      * version    date (UTC) lib source
 assertthat     0.2.1      2019-03-21 [1] CRAN (R 4.3.0)
 base64enc      0.1-3      2015-07-28 [1] CRAN (R 4.3.0)
 callr          3.7.3      2022-11-02 [1] CRAN (R 4.3.0)
 class          7.3-22     2023-05-03 [4] CRAN (R 4.3.1)
 classInt       0.4-9      2023-02-28 [1] CRAN (R 4.3.1)
 cli            3.6.1      2023-03-23 [1] CRAN (R 4.3.0)
 codetools      0.2-19     2023-02-01 [1] CRAN (R 4.3.0)
 colorspace     2.1-0      2023-01-23 [1] CRAN (R 4.3.0)
 crosstalk      1.2.0      2021-11-04 [1] CRAN (R 4.3.0)
 DBI            1.1.3      2022-06-18 [1] CRAN (R 4.3.0)
 digest         0.6.32     2023-06-26 [1] CRAN (R 4.3.1)
 dplyr        * 1.1.2      2023-04-20 [1] CRAN (R 4.3.0)
 e1071          1.7-13     2023-02-01 [1] CRAN (R 4.3.1)
 ellipsis       0.3.2      2021-04-29 [1] CRAN (R 4.3.0)
 evaluate       0.21       2023-05-05 [1] CRAN (R 4.3.0)
 fansi          1.0.4      2023-01-22 [1] CRAN (R 4.3.0)
 farver         2.1.1      2022-07-06 [1] CRAN (R 4.3.0)
 fastmap        1.1.1      2023-02-24 [1] CRAN (R 4.3.0)
 forcats      * 1.0.0      2023-01-29 [1] CRAN (R 4.3.0)
 generics       0.1.3      2022-07-05 [1] CRAN (R 4.3.0)
 ggplot2      * 3.4.2      2023-04-03 [1] CRAN (R 4.3.0)
 git2r          0.32.0     2023-04-12 [1] CRAN (R 4.3.0)
 git2rdata    * 0.4.0      2022-03-17 [1] CRAN (R 4.3.0)
 glue           1.6.2      2022-02-24 [1] CRAN (R 4.3.0)
 gtable         0.3.3      2023-03-21 [1] CRAN (R 4.3.0)
 hms            1.1.3      2023-03-21 [1] CRAN (R 4.3.0)
 htmltools      0.5.5      2023-03-23 [1] CRAN (R 4.3.0)
 htmlwidgets    1.6.2      2023-03-17 [1] CRAN (R 4.3.0)
 INLA         * 23.06.29   2023-06-30 [1] local
 inlabru        2.8.0      2023-06-20 [1] CRAN (R 4.3.1)
 jsonlite       1.8.7      2023-06-29 [1] CRAN (R 4.3.1)
 KernSmooth     2.23-21    2023-05-03 [1] CRAN (R 4.3.0)
 knitr        * 1.43       2023-05-25 [1] CRAN (R 4.3.0)
 labeling       0.4.2      2020-10-20 [1] CRAN (R 4.3.0)
 lattice        0.21-8     2023-04-05 [4] CRAN (R 4.3.0)
 leafem         0.2.0      2022-04-16 [1] CRAN (R 4.3.1)
 leaflet      * 2.1.2      2023-03-10 [1] CRAN (R 4.3.0)
 lifecycle      1.0.3      2022-10-07 [1] CRAN (R 4.3.0)
 lubridate    * 1.9.2.9000 2023-05-15 [1] https://inbo.r-universe.dev (R 4.3.0)
 magrittr       2.0.3      2022-03-30 [1] CRAN (R 4.3.0)
 mapview      * 2.11.0     2022-04-16 [1] CRAN (R 4.3.1)
 Matrix       * 1.5-4.1    2023-05-18 [1] CRAN (R 4.3.0)
 MatrixModels   0.5-1      2022-09-11 [1] CRAN (R 4.3.0)
 mgcv           1.8-42     2023-03-02 [1] CRAN (R 4.3.0)
 munsell        0.5.0      2018-06-12 [1] CRAN (R 4.3.0)
 nlme           3.1-162    2023-01-31 [1] CRAN (R 4.3.0)
 pillar         1.9.0      2023-03-22 [1] CRAN (R 4.3.0)
 pkgconfig      2.0.3      2019-09-22 [1] CRAN (R 4.3.0)
 plotROC      * 2.3.0      2022-05-26 [1] CRAN (R 4.3.1)
 plyr           1.8.8      2022-11-11 [1] CRAN (R 4.3.0)
 png            0.1-8      2022-11-29 [1] CRAN (R 4.3.0)
 processx       3.8.2      2023-06-30 [1] CRAN (R 4.3.1)
 proxy          0.4-27     2022-06-09 [1] CRAN (R 4.3.1)
 ps             1.7.5      2023-04-18 [1] CRAN (R 4.3.0)
 purrr        * 1.0.1      2023-01-10 [1] CRAN (R 4.3.0)
 R6             2.5.1      2021-08-19 [1] CRAN (R 4.3.0)
 raster         3.6-23     2023-07-04 [1] CRAN (R 4.3.1)
 RColorBrewer   1.1-3      2022-04-03 [1] CRAN (R 4.3.0)
 Rcpp           1.0.10     2023-01-22 [1] CRAN (R 4.3.0)
 readr        * 2.1.4      2023-02-10 [1] CRAN (R 4.3.0)
 rlang          1.1.1      2023-04-28 [1] CRAN (R 4.3.0)
 rmarkdown      2.23       2023-07-01 [1] CRAN (R 4.3.1)
 rstudioapi     0.14       2022-08-22 [1] CRAN (R 4.3.0)
 satellite      1.0.4      2021-10-12 [1] CRAN (R 4.3.1)
 scales       * 1.2.1      2022-08-20 [1] CRAN (R 4.3.0)
 sessioninfo    1.2.2      2021-12-06 [1] CRAN (R 4.3.0)
 sf           * 1.0-13     2023-05-24 [1] CRAN (R 4.3.0)
 sp           * 2.0-0      2023-06-22 [1] CRAN (R 4.3.1)
 stringi        1.7.12     2023-01-11 [1] CRAN (R 4.3.0)
 stringr      * 1.5.0      2022-12-02 [1] CRAN (R 4.3.0)
 terra          1.7-39     2023-06-23 [3] CRAN (R 4.3.1)
 tibble       * 3.2.1      2023-03-20 [1] CRAN (R 4.3.0)
 tidyr        * 1.3.0      2023-01-24 [1] CRAN (R 4.3.0)
 tidyselect     1.2.0      2022-10-10 [1] CRAN (R 4.3.0)
 tidyverse    * 2.0.0      2023-02-22 [1] CRAN (R 4.3.0)
 timechange     0.2.0      2023-01-11 [1] CRAN (R 4.3.0)
 tzdb           0.4.0      2023-05-12 [1] CRAN (R 4.3.0)
 units          0.8-2      2023-04-27 [1] CRAN (R 4.3.0)
 utf8           1.2.3      2023-01-31 [1] CRAN (R 4.3.0)
 vctrs          0.6.3      2023-06-14 [1] CRAN (R 4.3.0)
 webshot        0.5.5      2023-06-26 [1] CRAN (R 4.3.1)
 withr          2.5.0      2022-03-03 [1] CRAN (R 4.3.0)
 xfun           0.39       2023-04-20 [1] CRAN (R 4.3.0)
 yaml           2.3.7      2023-01-23 [1] CRAN (R 4.3.0)

 [1] /home/thierry/R/x86_64-pc-linux-gnu-library/4.3
 [2] /usr/local/lib/R/site-library
 [3] /usr/lib/R/site-library
 [4] /usr/lib/R/library

──────────────────────────────────────────────────────────────────────────────

Footnotes

  1. can be done in as little as three taps.↩︎