SDI: Sexual dimorphism index.

Description Usage Arguments Value Author(s) References Examples

View source: R/summary_stats.R

Description

Calculates the sexual dimorphism index of Lovich & Gibbons (1992): (larger sex / smaller sex) - 1 and arbitrarily made positive when females are the larger sex or negative when males are the larger sex.

Usage

1
SDI(t, dfin)

Arguments

t

Character object naming a trait in dfin.

dfin

Data frame which must contain at least three columns: one containing trait names that match t, a column with female measurements that must match "female" exactly, and a column with male measurements that must match "male" exactly.

Value

A numeric representing the calculated sexual dimorphism index for trait t.

Author(s)

[email protected]

References

Lovich, JE & Gibbons, JW. 1992. A review of techniques for quantifying sexual size dimorphism. Growth, Development, and Ageing 56(4):269-281.

Examples

1
2
3
4
5
6
popDat <- data.frame(trait = c("length", "weight", "coloration", "intelligence"),
   female = c(4.2, 255.0, 0.57, 144),
   male = c(3.7, 255.0, 0.89, 143))
SDI("length", popDat)
sapply(popDat$trait, FUN = SDI, dfin = popDat)
stopifnot(SDI("weight", popDat) == 0.0)

matthewwolak/wolakR documentation built on Feb. 25, 2018, 9:38 a.m.