knitr::opts_chunk$set( collapse = TRUE, comment = "#>", message=FALSE, warning = FALSE )
As the figure below illustrates, the wildboar GPS collars adhere to a complex sampling regime. Please consider this when doing your analysis!
knitr::include_graphics("images/sampling_regime.jpg")
The above figure was generated using the following code:
library(ComputationalMovementAnalysisData) library(ggplot2) library(dplyr) library(forcats) limits <- c(0,200) breaks = seq(0,200,50) labels = paste(c(rep("",length(breaks)-1),">"), breaks) wildschwein_BE %>% mutate(TierName = fct_reorder(TierName, DatetimeUTC,min, .desc = TRUE)) %>% group_by(TierID, TierName, CollarID) %>% mutate( timelag = as.numeric(difftime(lead(DatetimeUTC),DatetimeUTC, units = "mins")), ) %>% ggplot(aes(DatetimeUTC, TierName, colour = timelag)) + geom_line(lwd = 10) + scale_color_gradientn(name = "Sampling interval", colours = RColorBrewer::brewer.pal(11, "Spectral"), limits = limits, na.value = NA, oob = scales::squish, breaks = seq(0,200,50), labels = labels) + theme_minimal() + theme(legend.position = "top") + guides(color = guide_colorbar(title.position = "top", title.hjust = .5, barwidth = unit(20, "lines"), barheight = unit(.5, "lines")))
ggsave("vignettes/images/sampling_regime.jpg", height = 8, width = 10, dpi = 300, units = "in")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.