Learn R Programming

ShapeRotator (version 0.1.0)

match.datasets: match.datasets

Description

Matches two arrays by their dimnames

Usage

match.datasets(data.1, data.2)

Arguments

data.1

an object of the class "array" that contains three-dimensional landmarks for structure #1 (e.g. skull)

data.2

an object of the class "array" that contains three-dimensional landmarks for structure #2 (e.g. mandible)

Value

This function returns a list with the two translated arrays of dimensions (p, 3, n), in which dimnames associated with each specimen (n) are in the same order.

Details

Takes the two translated arrays and joined them by dimnames. Unmatched datasets (specimens missing in data.1 or data.2) are deleted.

References

M. Vidal-Garc<U+00ED>a, L. Bandara and J.S. Keogh. 2018. ShapeRotator: An R tool for standardized rigid rotations of articulated three-dimensional structures with application for geometric morphometrics. Ecology and Evolution. DOI: 10.1002/ece3.4018

Examples

Run this code
# NOT RUN {
# We need to match the dimnames of the translated datasets, but we have two
# extra specimens in data.1_t
# }
# NOT RUN {
length(dimnames(data.1_t)[[3]]) # n=12
length(dimnames(data.2_t)[[3]])  # n=10
matched <- match.datasets(data.1_t, data.2_t)

# When we matched the arrays, only matrices from specimens present in both
# datasets will be kept

length(dimnames(matched$matched1)[[3]]) # n=10

length(dimnames(matched$matched2)[[3]])  # n=10
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab