Read landmark data
read_lmdata( lmdata, specID = "None", remove_points = NA, path_to_tps = NA, plot = TRUE )
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 |
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 |
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
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)