Learn R Programming

MorphoTools2 (version 1.0.2.1)

cormat: Correlations of Characters

Description

The cormat function calculates the matrix of the correlation coefficients of the characters.

Usage

cormat(object, method = "Pearson")

cormatSignifTest(object, method = "Pearson", alternative = "two.sided")

Value

A data.frame, storing correlation coefficients for each pair of morphological characters.

Arguments

object

an object of class morphodata.

method

a character string indicating which correlation coefficient is to be used for the test. One of "Pearson" (default), or "Ppearman" can be applied.

alternative

indicates the alternative hypothesis and must be one of "two.sided" (default), "greater" (positive association) or "less" (negative association).

Details

This function returns table with pairwise correlation coefficients for each pair of morphological characters. The result is formatted as a data.frame to allow export with the exportRes function.

Significance tests are usually unnecessary for morphometric analysis. Anyway, if tests are needed, they can be computed using the cormatSignifTest function.

Examples

Run this code
data(centaurea)

correlations.p = cormat(centaurea, method = "Pearson")
correlations.s = cormat(centaurea, method = "Spearman")

if (FALSE) exportRes(correlations.p, file = "correlations.pearson.txt")
if (FALSE) exportRes(correlations.s, file = "correlations.spearman.txt")

correlations.p = cormatSignifTest(centaurea, method = "Pearson")

Run the code above in your browser using DataLab