svdPCO {MorphoRegions} | R Documentation |
Calculate PCO (principal co-ordinates analysis) based on SVD
Description
Calculates distance matrix from raw data, then conducts a PCO ordination using a
single value decomposition (SVD). This differs from other PCO functions which use stats::cmdscale()
and rely on a
spectral decomposition.
Usage
svdPCO(x, metric = "gower", scale = TRUE)
Arguments
x |
a |
metric |
string; the distance matrix calculation metric. Allowable options include those support by |
scale |
|
Value
A regions_pco
object, which contains eigenvectors in the scores
component and eigenvalues in the eigen.val
component. The original dataset is stored in the data
attribute.
See Also
plot.regions_pco()
for plotting PCO axes
cluster::daisy()
, which is used to compute the distance matrix used in the calculation; stats::cmdscale()
for a spectral decomposition-based implementation
Examples
data("alligator")
alligator_data <- process_measurements(alligator,
pos = "Vertebra")
# Compute PCOs
alligator_PCO <- svdPCO(alligator_data,
metric = "gower")
alligator_PCO
# Plot PCOs against vertebra index
plot(alligator_PCO, pco_y = 1:2)
# Plot PCOs against each other
plot(alligator_PCO, pco_y = 1, pco_x = 2)