read_lmdata: Read landmark data

Description Usage Arguments Value Examples

View source: R/read_lmdata.R

Description

Read landmark data

Usage

1
2
3
4
5
6
7
read_lmdata(
  lmdata,
  specID = "None",
  remove_points = NA,
  path_to_tps = NA,
  plot = TRUE
)

Arguments

lmdata

Path to single file or directory containing landmark data. Accepted file formats are Webmorph template files, a TPS file or a Webmorph list

specID

If reading TPS file, specify specID (see geomorphs's readland.tps)

remove_points

If reading TEM files, you can specify vector of points you want removed

path_to_tps

If reading TEM files or a Webmorph list, specify if you want to save data as TPS file

plot

Plot all specimens to check data (see geomorphs's plotAllSpecimens)

Value

Returns three-dimensional array of dimensions p, k, and n. p = number of landmarks, k = dimensionality of data (2D or 3D), n = number of specimens

Examples

1
2
3
4
5
6
7
8
path_to_tem <- system.file("extdata", "tem", package="facefuns")
data <- read_lmdata(lmdata =  path_to_tem)

# NOTE: You can also remove points on reading in your landmark data by specifying their indices
# If you are using Webmorph labels to decide which points to remove,
# add +1 as Webmorph is 0-based (in R, the index of Webmorph point "0 - left pupil" is 1)
remove_points <- c(44:49, 99:103, 115:124, 145:157, 158:163, 164:169, 170:173, 174:178, 183:184) + 1
data <- read_lmdata(lmdata =  path_to_tem, remove_points = remove_points)

iholzleitner/facefuns documentation built on March 19, 2021, 2:43 p.m.