gap_score: gap_score function

View source: R/gap_score.R

gap_scoreR Documentation

gap_score function

Description

Computes the gap score for a bird, using the unit table derived from all its recordings.

Usage

gap_score(gap_table, pop_means)

Arguments

gap_table:

A tibble as produced using the get_gaps function. It has Bird.ID, gap_dur, selec and transitions.

pop_means:

A tibble containing the mean gap lengths for each transition type. Columns should be transitions and mean_gap.

Details

For each transition type AB, compute

score_AB = log( individual mean AB gaps / population mean AB gaps )

The final score is the average of the scores for every transition type in the individual bird.

Examples

   unit_table = tibble::tibble(start = c(0.37, 0.6, 0.75, 1.2, 1.8, 2.5), 
end = c(0.45, 0.7, 0.9, 1.4, 2, 3), 
selec = seq(6),
sound.files = "JS001.wav", 
note_label = rep(c("A","B","C"),2))
gap_table = get_gaps(unit_table)
gap_score(gap_table)

Anthony-Kwong/birdsong.tools documentation built on April 14, 2023, 9:50 a.m.