% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/process_input.R
\name{process_gmPC}
\alias{process_gmPC}
\title{Process vertebral measurements and PC scores of 2D or 3D geometric morphometric data}
\usage{
process_gmPC(data, pos = "names", pcscores, eigenvals, specimens = NULL)
}
\arguments{
\item{data}{a 3D array (\eqn{p \times k \times n}) of Procrustes aligned landmarks where \eqn{p} is the number of of landmark points per vertebra, \eqn{k} is the number of landmark dimensions (2D or 3D), and \eqn{n} is the number of vertebrae sampled for the specimen.}

\item{pos}{either character string \code{"names"} in which case the function will extract vertebral position info form the names of the array (using \code{dimnames(data)[[3]]}), or a vector containing numeric values of vertebral position. Default is \code{"names"}.}

\item{pcscores}{a matrix or data frame containing PC scores of each vertebra.}

\item{eigenvals}{a numeric vector containing the eigenvalues of each PC axis.}

\item{specimens}{if \code{data} contains multiple specimens, a vector of specimen names of length equal to the number of vertebrae in \code{data}.}
}
\value{
A \code{regions_pco} object, which contains user-provided eigenvectors in the \code{scores} component and eigenvalues in the \code{eigen.val} component. The original dataset, including landmark coordinates and positional information, is stored in the \code{data} attribute.
}
\description{
\code{process_gmPC()} initializes the analysis workflow by processing vertebral measurements and already computed PC scores from 2D or 3D geometric morphometric datasets into an object usable by \pkg{MorphoRegions}. Such processing includes identifying the vertebra indices, measurements, and PC scores.
}
\details{
Unlike \code{process_measurements()}, \code{process_gmPC()} does not fill in missing values and these should have been removed or replaced by numeric values before running \code{process_gmPC()}.
}
\examples{
# Load coordinates of aligned landmarks, PC scores, and
# eigenvalues; vertebra index as names of array elements
# of aligned landmarks
data("seal_gmm")

# Process PC scores and morphological data:
seal_pca <- process_gmPC(data = seal_gmm$coord_gpa,
                         pcscores = seal_gmm$scores,
                         eigenvals = seal_gmm$eigenvals)

# Process multiple datasets; specimen names in 'specimens'
# vector, vertebrae index in 'vertebrae' vector
data("wolves_gmm")

# Process PC scores and geometric morphometric dataset:
wolves_pca <- process_gmPC(data = wolves_gmm$coord_gpa,
                           pos = wolves_gmm$vertebrae,
                           pcscores = wolves_gmm$scores,
                           eigenvals = wolves_gmm$eigenvals,
                           specimens = wolves_gmm$specimens)
}
\seealso{
\itemize{
\item \code{\link[=process_PC]{process_PC()}} for processing PC scores from traditional morphometric datasets
\item \code{\link[=svdPCO]{svdPCO()}} for computing principal coordinate axes from processed vertebra data.
\item \code{\link[=plot.regions_pco]{plot.regions_pco()}} for plotting PCO axes
}
}
