Learn R Programming

ARUtools

The goal of ARUtools is to facilitate the processing of ARU data and subsampling of recordings. Parse Autonomous Recording Unit (ARU) data and for sub-sampling recordings. Extract Metadata from your recordings, select a subset of recordings for interpretation, and prepare files for processing on the ‘WildTrax’ https://wildtrax.ca/ platform. Read and process metadata from recordings collected using the SongMeter and BAR-LT types of ARUs.

Installation

The easiest way to install ARUtools is with

install.packages("ARUtools")

Development version

You can install the most current version of ARUtools from the R-universe repository.

install.packages("ARUtools",
                 repos = c("https://arutools.r-universe.dev",
                           "https://cran.r-project.org") )

Alternatively you can build and install the package from GitHub with the code below. You will need to have Rtools installed first:

# install.packages("pak") # Uncomment if you don't have remotes installed.
pak::pak("arutools/ARUtools")

Using “remotes”

# install.packages("remotes")
remotes::install_github("arutools/ARUtools")

Learn to use

The easiest way to dig into using the ARUtools package is using the documentation webpage

There currently are six vignettes that will help you get up and running with cleaning ARU metadata

  • Getting started with ARUtools (vignette("ARUtools"))
  • Customizing clean_metadata() (vignette("customizing"))
  • Dealing with timezones (vignette("timezones"))
  • Working with spatial data (vignette("spatial"))
  • Subsampling recordings (vignette("SubSample"))
  • Other useful functions (vignette("Misc") )

Provide feedback

If you run into problems or have ideas for extensions, please don’t hesitate to submit an issue.

Motivation and limitations

This package initially started its life as a series of scripts to process recordings from multiple large projects around monitoring migratory bird populations in Ontario’s North.

Moving from scripts to package stemmed from following the wise advice from Hadley Wickham:

A good rule of thumb is to consider writing a function whenever you’ve copied and pasted a block of code more than twice (i.e. you now have three copies of the same code).

With multiple projects, each with their own data issues, it became clear that this would either require copy/pasting a lot of code and likely break something or developing a series of functions that could be shared across projects (i.e. a package).

While that initial version of the code was usable by me and only me, if you’re using the package, it is because of the fantastic work of Steffi LaZerte who translated my mess into the user-friendly functions you see today.

However, due to the variable nature of data management, it is possible that ARUtools may not work well for your project. If you run into issues, please do submit an issue.

There are also other good packages that may be of use to you:

Copy Link

Version

Install

install.packages('ARUtools')

Monthly Downloads

263

Version

0.7.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

David Hope

Last Published

March 19th, 2025

Functions in ARUtools (0.7.2)

common_docs

Common arguments and documentation for various functions
clean_metadata

Extract and clean ARU metadata from file names
create_dirs

Create directory structure for recording folders
clip_wave

Clip multiple wave files and format names
count_files

Count files in a project directory
clean_logs

Extract log data from BAR-LT log files
example_sites

Example site-level meta data
get_pattern

Returns the current vector of ARU types
get_wav_length

Get the length of a recording in seconds
meta_clean_logs

Run clean_logs() on the output from clean_metadata()
guess_ARU_type

Try to guess the ARU type from a file path
example_files

Example recording files
example_files_long

Example long-term deployment recording files
example_sites_clean

Example cleaned site-level meta data
example_clean

Example cleaned recording meta data
create_pattern

Create a pattern to match date
task_template

Example template of tasks for WildTrax
sample_recordings

Sample recordings
wind_detection_pre_processing

Pre-processing of files for Wind Detection program
template_observers

Example template of tasks for WildTrax
set_pattern

Set pattern into ARUtools environment
sox_spectro

Create spectrogram image from wave file
sim_selection_weights

Create parameters and simulate selection weights
temp_wavs

Helper function to create test wave files
wind_detection_summarize_json

Summarize wind detection results
wt_assign_tasks

Assign tasks for interpretation on Wildtrax
check_problems

Check problems in output of clean_metadata()
ARUtools

ARUtools: Management and Processing of Autonomous Recording Unit (ARU) Data
add_sites

Add site-level data to the metadata
acoustic_indices

Get acoustic complexity values
calc_selection_weights

Calculate Selection Weights
check_meta

Check output of clean_metadata()
check_file

Explore a file
calc_sun

Calculate time to sunrise/sunset
add_wildtrax

Add file name formated for Wildtrax to metadata
add_pattern_aru_type

Add an ARU to the list of identified ARUs
clip_wave_single

Clip single wave file
create_lookaround

Create a look around expression and add it to an existing regular expression
clean_site_index

Prepare and clean site index file
clean_gps

Check and clean GPS data