classify_mature: Classify mature

Description Usage Arguments Details Value Examples

View source: R/morphMat-main.R

Description

Classify the individuals in two groups (0: juveniles, 1: adults) based on relative growth.

Usage

1
2
3
4
5
6
7
classify_mature(
  data,
  varNames = c("x", "y"),
  varSex = "sex",
  selectSex = NULL,
  method = "ld"
)

Arguments

data

data.frame with allometric variables and sex category (male, female). If sex category contains NA's, that row will be filtered.

varNames

the name of two allometric variables to be used for analysis.

varSex

the name of the variable containing sex information.

selectSex

sex category to be used for analysis. If selectSex = NULL all the individuals will be used in the analysis.

method

a character string indicating the discriminant analysis method, linear discriminant analysis "ld", quadratic discriminant analysis "qd". We suggest begin the analysis using the method = "ld".

Details

Classify the individuals in two groups (juveniles = 0 and adult = 1).

A Principal Components Analysis was conducted with two allometric variables (x: independent variable, y: dependent variable) in log base, allowing to distinguish two groups that would represent juveniles and adult. The individuals are assigned to each group using a hierarchical classification procedure (hierarchical cluster with agglomeration method: "Ward.D" and the distance measure: "euclidean"). This method is based on establishing a predetermined number of groups (in this case, two) and assigning individuals to one of the groups according to their loads on the two axes of the PCA (Corgos and Freire, 2006).

Using the results of the classification (PCA + cluster), a discriminant analysis (linear or quadratic) is conducted to obtain a discriminating function that permitted any individuals to be classified as a juvenile or an adult on the basis of the X and Y allometric variables.

Value

A data.frame of class 'classify', with x (independent), y (dependent) and classification of maturity (juveniles = 0, adult = 1) variables.

Examples

1
2
3
4
5
6
data(crabdata)

classify_data = classify_mature(crabdata, varNames = c("carapace_width", "chela_height"),
varSex = "sex_category", selectSex = NULL, method = "ld")

classify_data

sizeMat documentation built on July 8, 2020, 7:27 p.m.