knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
Audiomoths are super cool autonomous recording units (ARUs) that record audio on a set recording schedule. They are often used to record the calls of birds or bats in an environment. Audiomoth.tools is a collection of functions that I have put together when using my Audiomoth. Feel free to recommend changes or improvements!
You can install the development version of this package from GitHub with:
# install.packages("remotes") remotes::install_github("samherniman/audiomoth.tools")
library(audiomoth.tools)
Currently, there are only two useful functions in this package:
Use extract_header_info
to extract the information contained in the headers of each WAV file. The headers contain the recording date, time, serial number, gain setting, battery state, and temperature. More details and Python code are provided by Open Acoustic Devices here. This function extracts these data from the header of all Audiomoth files in a given directory and returns a dataframe.
extract_header_info(system.file("extdata", package = "audiomoth.tools"), recursive = FALSE)
Here's an example of a figure you can make with the temperature.
header_df <- vroom::vroom(system.file("extdata", "header_df.csv", package = "audiomoth.tools")) library(ggplot2) library(magrittr) header_df %>% ggplot(data = .)+ geom_point(aes(x = recorded_date_time, y = temperature_celcius, color = temperature_celcius))+ geom_smooth( aes(x = recorded_date_time, y = temperature_celcius), method = 'gam', se = FALSE, color = "brown" )+ scico::scale_color_scico("Temperature (°C)", palette = "romaO", direction = -1) + labs(y = "Temperature (°C)", x = "Date") + theme( panel.background = element_rect(fill = "grey98"), panel.grid.major = element_blank(), panel.grid.minor = element_blank())
Depending on your version of the audiomoth software, filenames may look like 20210201_210100T.WAV
(YYYYMMDD_HHMMSST). If you want to upload these files to Arbimon, you may have to remove the T at the end of each filename. You can use rename_audiomoth_files
to do this.
rename_audiomoth_files(system.file("extdata", package = "audiomoth.tools"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.