Given that camera traps operate 24 hours a day, 7 days a week, and can record animal motion down to second-level precision, they represent a powerful tool to explore and contrast the activity patterns of the species they detect! Such analyses can give insight into competition, predation and coexistence. Characterizing the “activity level” - the proportion of the day which animals are active - is also increasingly important for new estimators of animal density (see the density chapter for more info). Consequently, understanding how to derive and use activity data is very important for people using camera traps.
Must read Frey, Sandra, et al. “Investigating animal activity patterns and temporal niche partitioning using camera‐trap data: Challenges and opportunities.” Remote Sensing in Ecology and Conservation 3.3 (2017): 123-132.
Two key packages
They each use the timestamps in camera trap detetions to derive activity indices which can be compared between different strata of interest (e.g. species, treatments etc.).
Here we will use the
A recent paper has highlighted that we need to carefully consider our data source for activity analyses:
Christopher Peral, Marietjie Landman, Graham I. H. Kerley The inappropriate use of time-to-independence biases estimates of activity patterns of free-ranging mammals derived from camera traps Ecology and Evolution
Whilst we typically use “independent data” for most of our camera trap analysis, doing so may throw away useful data on activity. Both in terms of the number of data points (power) but also the activity patterns they generate. Peral et.al show that 70% of papers published to date use independent data to derive their indices. They actually state:“We conclude that the application of time-to-independence data filters in camera trap-based estimates of activity patterns is not valid and should not be used.”
So we will use the raw data to derive our indices!
Load your packages
First, lets import the processed raw data file.
Which looks like this:
Then load the activity package:
If your cameras correct for daylight savings use the correct code, if they do not, use UTC.
Note - find your timezone code for the
tz= call here.
A recent paper highlighted the challenges in trying to understand animal activity patterns at high latitudes - as sunrise/sunset timings vary substantially through the calender year. See:
If we want to compare activity patterns between two different locations, or different seasons, the day length at the time the detection occurred can have a huge impact on our estimates of wildlife activity. For example, if we wanted to compare day/night activity between winter and summer periods, in winter animal activity is constrained to a much shorter day length.
Fortunately, the authors have a solution!
The average anchoring method
Instead of using the ‘human’ 24h clock, we can instead express animal activity relative to an important anchor point in the day (e.g. sunrise).
NOTE -the transformation is not necessary at latitudes below 20°, or in studies with a duration of less than a month (below 40° latitude), as day length doesn’t chnage substantially.
## Joining with `by = join_by(project_id, placename)`
# calculate solar time tmp <- solartime ( img_locs$timestamp, # the date time column img_locs$latitude, # Latitude img_locs$longitude, # Longitude tz=-6, # an offset in numeric hours to UTC (Alberta is 6 hours behind) format="%Y-%m-%d %H:%M:%S") # Although we want to use solar time, let's add both incase you want to explore the implications img_locs$solar <- tmp$solar img_locs$clock <- tmp$clock
Let’s check out the relationship between these two indices:
We are now ready to fit some models!
Let’s start with a white-tailed deer and caribou example.
Note we are reducing the number of replicates to 100 to speed up the process - typically people use 1000.
Take a look at the raw data if you want.
And repeat it for Caribou
We can plot both on the same axis as follows:
We can compare different activity patterns using coefficient of overlap (∆) - developed by Ridout and Linkie:
The coefficient ranges from 0 (no overlap) to 1 (complete overlap). We can implement for a two species comparison as follows:
## obs null seNull pNull ## 0.784652408 0.955259792 0.008606608 0.000000000
The output above represents:
0 = no overlap and 1 = high overlap!
obs= observed overlap index;
null= mean null overlap index;
seNull= standard error of the null distribution;
pNull= probability observed index arose by chance.
Which suggests there is reasonably high overlap between the two species - and that it did not come about by chance.
We can also compare patterns within a species across different strata of interest. For example, perhaps white-tailed deer change their activity patterns in response to the
feature_type they are using - perhaps they will be more nocturnal on
HumanUse lines relative to
Offline strata. Lets try it:
White-tail deer on HumanUse feature
White-tail deer on Offline feature
plot(m2, yunit="density", data="none", las=1, lwd=2, tline=list(lwd=2), # Thick line cline=list(lty=0)) # Supress confidence intervals plot(m1, yunit="density", data="none", add=TRUE, tline=list(col="red", lwd=2), cline=list(lty=0)) legend("topright", c("Offline", "HumanUse"), col=1:2, lty=1, lwd=2)
## obs null seNull pNull ## 0.82674255 0.96140086 0.01041054 0.00000000
There is very high overlap for these comparisons, and it is unlikely to have arisen by chance! So it seems the edidence for changes in temporal activity in response to feature_type is weak - at least for the white-tiled deer!
img_locs$month <- month(img_locs$timestamp, label=T) #Fit an activity model m1 <- fitact(img_locs$solar[img_locs$sp=="Rangifer.tarandus" & img_locs$month %in% c("Apr", "May", "Jun", "Jul", "Aug", "Sep")], sample="model", reps=100) m2 <- fitact(img_locs$solar[img_locs$sp=="Rangifer.tarandus" & img_locs$month %in% c("Oct", "Nov", "Dec", "Jan", "Feb", "Mar")], sample="model", reps=100)
Try your own species comparisons. Remember we have the following species:
##  "Lynx.canadensis" "Canis.lupus" ##  "Ursus.americanus" "Alces.alces" ##  "Odocoileus.virginianus" "Canis.latrans" ##  "Cervus.canadensis" "Lontra.canadensis" ##  "Martes.americana" "Rangifer.tarandus" ##  "Vulpes.vulpes" "Oryctolagus.cuniculus" ##  "Lepus.americanus" "Tamiasciurus.hudsonicus"
You can also try other categorical strata comparisons, we have:
## ## HumanUse NatRegen Offline ## 14 11 13