View source: R/coordinates.difference.R
coordinates.difference | R Documentation |
Calculates coordinate differences (e.g. from Procrustes superimpositions)
coordinates.difference(
coordinates,
reference,
type = "cartesian",
angle = "degree",
absolute.distance = TRUE,
rounding = NULL
)
coordinates |
An |
reference |
A |
type |
the type of coordinates to output: can be |
angle |
optional, whether display angles in radian ( |
absolute.distance |
|
rounding |
optional, a tolerance value for rounding pairs of landmarks (passed to |
When using type = "vector"
with absolute.distance = TRUE
, the distance between two landmarks A and A' is calculated as d(0,A') - d(0,A) where 0 is the centroid of the shape to analysis.
A positive absolute distance means that A' is further away from the centroid than A.
A negative absolute distance means that A' closer to the centroid than A.
When using absolute.distance = FALSE
, the distance is calculated as d(A,A') and is always positive.
Thomas Guillerme
variation.range
## Loading the geomorph dataset
require(geomorph)
data(plethodon)
## Performing the Procrustes superimposition
proc_super <- geomorph::gpagen(plethodon$land, print.progress = FALSE)
## Getting the coordinates differences from the consensus
cartesian_diff <- coordinates.difference(proc_super$coords, proc_super$consensus)
## The coordinates of the differences between the first specimen and the consensus
head(cartesian_diff[[1]])
## Getting the spherical coordinates difference between the two first specimen
coordinates.difference(proc_super$coords[, , 1], proc_super$coords[, , 2],
type = "spherical", angle = "degree")
## Getting the vector coordinates for the same specimen in relative distance
coordinates.difference(proc_super$coords[, , 1], proc_super$coords[, , 2],
type = "vector", angle = "degree", absolute.distance = FALSE)
## Getting the vector same coordinates in absolute distances
coordinates.difference(proc_super$coords[, , 1], proc_super$coords[, , 2],
type = "vector", angle = "degree")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.