Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

two.d.array

Convert (p x k x n) data array into 2D data matrix


Description

Convert a three-dimensional array of landmark coordinates into a two-dimensional matrix

Usage

two.d.array(A, sep = ".")

Arguments

A

A 3D array (p x k x n) containing landmark coordinates for a set of specimens

sep

An optional argument for variable labeling, combining landmark labels (e.g., 1, 2, 3, ...) and partial dimension labels (e.g., "x", "y", and "z"), much like the paste function. The default is sep = ".", but this can be changed to any separator. One should make sure to match separators with arrayspecs if switching between matrices and arrays.

Details

This function converts a (p x k x n) array of landmark coordinates into a two-dimensional matrix (n x [p x k]). The latter format of the shape data is useful for performing subsequent statistical analyses in R (e.g., PCA, MANOVA, PLS, etc.). Row labels are preserved if included in the original array.

Value

Function returns a two-dimensional matrix of dimension (n x [p x k]), where rows represent specimens and columns represent variables.

Author(s)

Dean Adams and Emma Sherratt

See Also

Examples

data(plethodon) 
plethodon$land    #original data in the form of 3D array

two.d.array(plethodon$land)   # Convert to a 2D data matrix

geomorph

Geometric Morphometric Analyses of 2D/3D Landmark Data

v4.0.0
GPL (>= 2)
Authors
Dean Adams [aut, cre], Michael Collyer [aut], Antigoni Kaliontzopoulou [aut], Erica Baken [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.