% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fcn_PCA.R
\name{getPCA}
\alias{getPCA}
\title{Create a principal component analysis (PCA) plot for the first two dimensions.}
\usage{
getPCA(data, do_plot = TRUE, connect_line_order = NA, gg_layer)
}
\arguments{
\item{data}{Matrix(!) where each row is one high-dimensional point, with ncol dimensions, 
e.g. a mouse as an array of proteinexpressions
rownames(data) give classes for colouring (can be duplicates in matrices, as opposed to data.frames)}

\item{do_plot}{Show PCA plot? if ==2, then shows correlations plot as well}

\item{connect_line_order}{Connect points by lines, the order is given by this vector.
Default: NA (no lines)}

\item{gg_layer}{More parameters added to a ggplot object (ggplot(x) + gg_layer)}
}
\value{
[invisible] Named list with "PCA": The PCA object as returned by \code{\link[stats]{prcomp}}, access $x for PC values
                                and "plots": list of plot objects (one or two)
}
\description{
Create a principal component analysis (PCA) plot for the first two dimensions.
}
\examples{
n = 5
m = 10
data = matrix(runif(n * m), nrow = n, ncol = m)
rownames(data) = 1:n
getPCA(data, connect_line_order = 1:n, gg_layer = ggplot2::ggtitle("test"))

}
