asShapeArray: asShapeArray

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/qtleffect_shape.R

Description

Convert a matrix of landmark coordinates into an array [n.land x n.dim x n.obs].

Usage

1
asShapeArray(shapes, n.land, n.dim, byrow = TRUE)

Arguments

shapes

A matrix of shape coordinates n.obs rows of [x1 y1 z1 x2 y2 z2 ...]

n.land

Number of landmarks

n.dim

Number of dimensions (2 or 3)

byrow

logical (default TRUE: data arranged initially according to x1 y1 z1 x2 y2 z2...). FALSE: data arranged initially according to x1 x2 x3 .... xp y1 .... yp z1 .... zp (used in the Morpho package)

Details

The function converts a matrix of landmark coordinates into an array. Such arrays are common format used in other morphometrics packages (shape, geomorph, Morpho). Each row of the input matrix contains coordinates for a single specimens.

Value

The function returns a multidimensional array [n.land x n.dim x n.obs]. The third dimension contains the names of each specimens if it was specified as row names in the input matrix.

Author(s)

Nicolas Navarro

See Also

arrayspecs

Examples

1
2
x <- matrix(rnorm(5*3*2),nrow=5, byrow=TRUE) # 5 random triangles
asShapeArray(x, 3, 2, byrow = TRUE)

nnavarro/shapeQTL documentation built on April 30, 2021, 12:10 p.m.