read.tps: Read shape data from a TPS file

read.tpsR Documentation

Read shape data from a TPS file

Description

A wrapper function for readland.tps, which reads a tps file to obtain landmark coordinates.

Usage

read.tps(
  file,
  specID = "ID",
  negNA = FALSE,
  readcurves = FALSE,
  warnmsg = TRUE,
  extract.id.metadata = TRUE,
  keep.original.ids = FALSE,
  show.plot = TRUE,
  square = TRUE,
  links = NULL,
  text.color = "darkred",
  line.color = "darkgray",
  reflect.specimens = FALSE,
  top.pt = NULL,
  bottom.pt = NULL,
  left.pt = NULL,
  right.pt = NULL,
  verbose = TRUE
)

Details

If extract.id.metadata = TRUE (the default) then the function will extracts metadata embedded in the ID lines based on the separator and metadata factor names described in the header of the tps file. If reflect.specimens = TRUE then the function will also re-orient specimens using align.reflect.

Value

Returns a list with several elements: coords, containing a 3-dimensional array of shape coordinates; and landmark.number and specimen.number, containing integer values. scaled is a logical flag for whether scaling has been applied to shape coordinates. Data provenance is incluided in an element, provenance, which is itself a list recording data manipulations made by functions in the borealis package.

Source

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

References

Rohlf, FJ. 2015. The tps series of software. Hystrix 26, 9–12. (Link)

Geomorph: Software for geometric morphometric analyses. R package version 3.2.1. D.C. Adams and M.L. Collyer and A. Kaliontzopoulou. 2020. (Link)

Examples

shapes <- read.tps("sample.tps", show.plot = FALSE)

shapes <- read.tps("sample.tps")

shapes <- read.tps("sample.tps", links = "chull")

shapes <- read.tps("sample.tps",
                   links = "chull",
                   reflect.specimens = TRUE,
                   verbose = FALSE)

names(shapes)

shapes$landmark.number

shapes$specimen.number

cat(shapes$provenance)


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