Learn R Programming

paleomorph (version 0.1.4)

mirrorfill1: Fill missing landmarks for a single specimen using mirrored values from other side of object

Description

Given an n x 3 matrix, replace a set of landmarks using their mirrored counterpart.

Usage

mirrorfill1(s, l1, l2)

Arguments

s
An n x 3 matrix containing 3D landmark data of n landmarks.
l1
Vector of indices for which landmarks to use to make a specimen midline.
l2
Vector or matrix of pairs of symmetrical landmarks.

Details

l2 should be either
  • An even length vector containing pairs of landmarks on either side of the specimen. i.e. l2[1] and l2[2] are paired, l2[3] and l2[4] are paired etc.
  • A two column matrix with each row giving a pair of symmetrical landmarks.

Examples

Run this code
 # Make data that is reflected in x plane
 s <- matrix(rep(1:21, 2), byrow = TRUE, ncol = 3)
 s[1:7, 1] <- -s[1:7, 1]

 # Now remove some data
 s[1, ] <- NA
 
 # Mirror point 1 using it's complimentary landmark, point 8.
 mirrorS <- mirrorfill1(s, l1 = c(2:7, 9:14), l2 = c(1, 8))

Run the code above in your browser using DataLab