gap_var_score: get_var_score function

View source: R/gap_var_score.R

gap_var_scoreR Documentation

get_var_score function

Description

Takes a gap_table for an individual and computes the overall variability score for an individual bird.

Usage

gap_var_score(gap_table, bird, denom_var = T, min = 2)

Arguments

gap_table:

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

bird:

The ID of the bird to compute the gap variance score for.

denom_var:

logical indicating whether the standard denominator for variance N-1 should be used instead of N. T is for N-1, F for N. Default is N-1.

min:

The minimum number of transitions required for computing the bird's individual Cjb (coefficient of variation). If the bird sings less of a transition than min, the coefficient is 0. Default min = 2.

Details

The function first sorts the gaps by transition type and computes a score for each transition. This is the variance of the gaps, divided by their mean. The final score is a linear combination of the scores for each transition. The constant for the score for transition type AB is the total number AB transitions divided by the total number of transitions - the number of transition types.

The score is the variance of all the gaps, divided by their mean.

Value

A numeric, scalar score for the bird

Examples

unit_table = tibble::tibble(start = c(0.37, 0.6, 0.75, 0.2, 1.8, 2.5), 
end = c(0.45, 0.7, 0.9, 0.4, 2, 3), 
selec = c(1,2,3,1,2,3),
sound.files = c(rep("JS001.wav",6)), 
note_label = rep(c("A","B","C"),2))
output = get_gaps(unit_table)
get_var_score_dep(output)

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