align.reflect: Consistently orient specimens in an array of coordinate shape...

View source: R/align.reflect.R

align.reflectR Documentation

Consistently orient specimens in an array of coordinate shape values

Description

The input array should contain landmark coordinates with p, 2, and n dimensions, where n is the number of specimens and p is the number of landmarks). Dimension 2 must have two columns that contain X and Y locations of the landmark. The function will pass extra arguments to landmark.plot, including links. Plotting the landmarks can be useful to ensure that the reference specimen and pivot point result in sensible alignments for the other specimens. If the input is a list, all elements will be retained in the output. If a provenance element is present, then it will be expanded to include an entry for this processing step.

Usage

align.reflect(
  A,
  top.pt = NULL,
  bottom.pt = NULL,
  left.pt = NULL,
  right.pt = NULL,
  show.plot = TRUE,
  verbose = TRUE,
  provenance = NULL,
  ...
)

Arguments

A

A 3-dimensional array containing XY shape corrdinates for multiple specimens, or a list containing such as an array and data provenance.

top.pt

The row number of the landmark that should be on top.

bottom.pt

The row number of the landmark that should be on the bottom.

left.pt

The row number of the landmark that should be on the left.

right.pt

The row number of the landmark that should be on the right.

show.plot

A logical factor or index number specifying whether to display a plot showing the alginment of one specimen relative to the reference. If show.plot = TRUE (the default), then a specimen is plotted at random. Alternatively, a specimen can be indicated as in show.plot = 1. To suppress the visual output, set If show.plot = FALSE.

verbose

A logical factor specifying whether to report out corrections to each specimen.

provenance

An object that should be retained for data provenance.

Details

If no values are given for the top, bottom, left or right landmarks, then all specimens will be oriented to match the first specimen in the array.

Value

Returns a list with coords, provenance, and any other potential list elements from the input.

Source

Dave Angelini david.r.angelini@gmail.com [aut, cre]

Examples

data(plethodon, package = "geomorph")

pletho.links <- matrix(c(4,5,5,6,6,7,7,8,8,9,9,10,10,11,2,4,12,2,3,5),
                       ncol = 2, byrow = TRUE)

curated.coords <- align.reflect(
  plethodon,
  top.pt = 8, right.pt = 7,
  links = pletho.links )


aphanotus/borealis documentation built on Nov. 4, 2022, 8:44 p.m.