BioAcoustic EveNT ClassifiER

Create a hierarchical acoustic event species classifier out of multiple call type detectors as described in Rankin et al (2017) .


banter is a package for creating hierarchical acoustic event classifiers out of multiple call type detectors.


To install the latest version from GitHub:

# make sure you have Rtools installed
if(!require('devtools')) install.packages('devtools')
# install from GitHub


The BANTER model is initialized with a data.frame of events. There is one row per event and it must have a column called which is a unique id for each event, and a column called species which assigns each event to a given species. Every other column in the data.frame will be used as a predictor variable for the events.
In the package, an example data.frame is in the example data list as the $events element.

bant.mdl <- initBanterModel($events)

Next, detector data is added to the initialized BANTER model object. Each detector is a data.frame with a column called that associates the detected call with an event that the model was initialized with, and a column that provides a unique identifier for each call. Every other column will be used as a predictor variable for the calls.
In the package, example data.frames for three detectors are provided in the $detectors element of the example data list. Here is an example of adding the burst pulse (bp) detector.

bant.mdl <- addBanterDetector(
  data =$detectors$bp, 
  name = "bp",
  ntree = 10, 
  sampsize = 1

The addBanterDetector function can be called repeatedly to add additional detectors. Alternatively, if the detectors are all in a named list, they can be added at once:

bant.mdl <- addBanterDetector(
  data =$detectors, 
  ntree = 10, 
  sampsize = 1

Once all of the detectors have been added, then the full BANTER model is run:

bant.mdl <- runBanterModel(bant.mdl, ntree = 5000, sampsize = 3)

The model can be easily summarized:


The actual randomForest model can be extracted for the event or detector models:

# extract event Random Forest model
event.rf <- getBanterModel(bant.mdl, "event")
# extract burst pulse (bp) Random Forest model
bp.rf <- getBanterModel(bant.mdl, "bp")

These can then be visualized using other tools, such as those in the rfPermute package:


To predict novel data, it must be in a list with the event data in the $events element, and the detector data in a named list called $detectors:




Rankin, S., Archer, F., Keating, J. L., Oswald, J. N., Oswald, M., Curtis, A. and Barlow, J. (2017) Acoustic classification of dolphins in the California Current using whistles, echolocation clicks, and burst pulses. Mar Mam Sci, 33: 520-540. doi:10.1111/mms.12381

version 0.9.2

  • Initial release


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.9.4 by Eric Archer, 15 days ago

Browse source code at

Authors: Eric Archer [aut, cre] , Taiki Sakai [aut]

Documentation:   PDF Manual  

GNU General Public License license

Imports dplyr, ggplot2, gridExtra, methods, parallel, randomForest, rfPermute, rlang, stats, swfscMisc, tibble, tidyr

Depends on magrittr

Suggests testthat

See at CRAN