angler is currently still in the developmental stage, and thus has limited usage (which we illustrate below)
Sexual dimorphism (i.e the differences between males and females) is
largely prevalent in the natural world, and has been widely observed to
be exhibited in a range of patterns across various clades. A critical
issue that hampers the study of sexual dimorphism is the lack of
standardized measures in the literature to calculate sexual shape and
size dimorphism. angler
computes a set of commonly used measures of
sexual size dimorphism (SSD) and shape dimorphism (SShD) from landmark
based morphometric data for future studies to conveniently calculate
standardized effect sizes of sexual dimorphism. The package additionally
computes a bootstrapped-based standard error for the various measures
included in the package.
This package is not available on CRAN as of this date (although it is intended to be submitted soon). You can install the development version of angler from GitHub by running the following line of code:
devtools::install_github("ntmv/angler")
We demonstrate the use of the current version of the package using the
pupfish
dataset which is exported with the package. The first step
before performing an analysis using angler
is to use our sex
conversion function, in order to convert the sex vector of the input
dataset into a compatible format.
# Load package
library(angler)
# Load pupfish example data
data(pupfish)
# Convert sex
pupfish$Sex <- with(pupfish, ConvertSexFormat(Sex)); levels(pupfish$Sex)
#> [1] "f" "m"
angler
offers two measures of sexual size dimorphism: 1) The SDI
Measure (Lovich and Gibbons 1992) and 2) The log ratio of sexual
dimorphism, log(F/M) (adapted with alterations from Smith 1999). We
demonstrate the use of both:
# SSDI
with(pupfish, SSDI(CS, Sex))
#> [1] -0.1624368
# Log ratio
with(pupfish, SSDLog(CS, Sex))
#> [1] -0.1505185
Smith 1999 has the log ratio with male biased being positive and female
biased being negative (suited to mammalian research). We can have the
statistic operate in that manner by setting positiveM = TRUE
.
with(pupfish, SSDLog(CS, Sex, positiveM = T))
#> [1] 0.1505185
(WIP)
- Clean up documentation of functions
- Add parallel support for strata functions which take long time to run + vectorize
- More error checks for sample sizes for within-strata bootstrapping
- General function check
- Testing
- Update README with examples
- Add vignette and pkgdown website for code documentation and examples
- General formatting
- Mahalanobis distance: sparse variance-covariance estimation