Learn R Programming

IDmeasurer

The goal of IDmeasurer package is to provide tools for assessment and quantification of individual identity information in animal signals. This package accompanies a research article by Linhart et al.: ‘Measuring individual identity information in animal signals: Overview and performance of available identity metrics’, which can currently be accessed at BioRxive.

Installation

The package is currently available at GitHub:

devtools::install_github('pygmy83/IDmeasurer', build = TRUE, build_opts = c("--no-resave-data", "--no-manual"))

The package has been also submitted to CRAN and it should be soon possible to install the released version of IDmeasurer from CRAN with:

install.packages("IDmeasurer")

Example

This is a basic example which shows how to calculate individual identity information in territorial calls of little owls (ANspec example data):

library(IDmeasurer)

Input data for the calculation of identity metrics in this package, in general, is a data frame with the first column containing individual identity codes (factor) and the other columns containing individuality traits (numeric).

summary(ANspec)   
#>        id           dur               df              minf       
#>  007a   : 10   Min.   :0.3680   Min.   : 547.2   Min.   : 476.6  
#>  042a   : 10   1st Qu.:0.5040   1st Qu.: 955.7   1st Qu.: 742.2  
#>  045a   : 10   Median :0.5680   Median :1014.0   Median : 820.3  
#>  055a   : 10   Mean   :0.5733   Mean   :1033.0   Mean   : 798.7  
#>  062a   : 10   3rd Qu.:0.6320   3rd Qu.:1073.6   3rd Qu.: 890.6  
#>  070p   : 10   Max.   :0.9760   Max.   :1781.4   Max.   :1101.6  
#>  (Other):270                                                     
#>       maxf             q25              q50              q75        
#>  Min.   : 929.7   Min.   : 570.3   Min.   : 875.0   Min.   : 898.4  
#>  1st Qu.:1234.4   1st Qu.: 906.3   1st Qu.: 992.2   1st Qu.:1109.4  
#>  Median :1839.8   Median : 953.1   Median :1039.1   Median :1203.1  
#>  Mean   :1609.0   Mean   : 959.0   Mean   :1049.6   Mean   :1291.4  
#>  3rd Qu.:1882.8   3rd Qu.:1007.8   3rd Qu.:1084.0   3rd Qu.:1523.4  
#>  Max.   :1937.5   Max.   :1203.1   Max.   :1398.4   Max.   :1750.0  
#> 

This calculates HS metric for every single trait variable in the dataset.

calcHS(ANspec, sumHS=F)
#>   vars Pr   HS
#> 2  dur  0 1.13
#> 3   df  0 0.58
#> 4 minf  0 0.80
#> 5 maxf  0 1.06
#> 6  q25  0 1.04
#> 7  q50  0 1.48
#> 8  q75  0 0.93

To calculate the HS for an entire signal, it is neccessary to have uncorrelated variables in dataset. Raw (correlated) trait variables need to be transformed into principal components by the Principal component analysis.

temp <- calcPCA(ANspec) 

Calculate HS for an entire signal.

calcHS(temp) 
#> HS for significant vars         HS for all vars 
#>                    4.68                    4.68

To see description of the example dataset, use:

?ANspec

More examples can be found in IDmeasurer vignette:

vignette('idmeasurer-workflow-examples')

Copy Link

Version

Install

install.packages('IDmeasurer')

Monthly Downloads

205

Version

1.0.0

License

CC0

Maintainer

Pavel Linhart

Last Published

May 9th, 2019

Functions in IDmeasurer (1.0.0)

SSgrunts

Domestic pig, Sus scrofa domestica - piglet grunts
calcDS

Calculates discrimination score (DS)
calcPIC

Calculates potential of identity coding (PIC, variant=PICbetweentot)
calcPICbetweenmeans

Calculates potential of identity coding (PIC, variant=PICbetweenmeans)
CCformants

Corncrake, Crex crex - formants
calcHSvarcomp

Calculate Beecher's information statistic (HS, variant = HSvarcomp)
CCspec

Corncrake, Crex crex - spectrum properties
IDmeasurer

IDmeasurer: A package for calculation of individual identity metrics in animal signals.
ANmodulation

Little owl, Athene noctua - frequency modulation
LAhighweewoo

Yellow-breasted boubou, Laniarius atroflavus - spectrum properties
calcMI

Calculate Mutual information (MI)
calcPICbetweentot

Calculates potential of identity coding (PIC, variant=PICbetweentot)
convertDStoHS

Convert DS to HS
ANspec

Little owl, Athene noctua - spectrum properties
GenerateMultivariate

Generate dataset with multiple individual identity traits
GenerateUnivariate

Generate dataset with a single individual identity trait
calcHSntot

Calculate Beecher's information statistic (HS, variant = HSntot)
calcHSnpergroup

Calculate Beecher's information statistic (HS, variant = HSnpergroup)
calcDistT

Calculate total distance in given dataset
calcDistW

Calculate average within individual distance
calcF

Calculate F-values for individual identity traits
calcHM

Calculate information capacity (HM)
calcMeanVec

Calculate the centroid of the individual identity traits
calcPCA

Convert raw trait variables into principal components
calcHS

Calculate Beecher's information statistic (HS, variant = HSnpergroup)
calcHSngroups

Calculate Beecher's information statistic (HS, variant = HSngroups)
convertHStoDS

Convert HS to DS