% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/iobr_pca.R
\name{iobr_pca}
\alias{iobr_pca}
\title{Principal Component Analysis (PCA) Visualization}
\usage{
iobr_pca(
  data,
  is.matrix = TRUE,
  scale = TRUE,
  is.log = FALSE,
  pdata,
  id_pdata = "ID",
  group = NULL,
  geom.ind = "point",
  cols = "normal",
  palette = "jama",
  repel = FALSE,
  ncp = 5,
  axes = c(1, 2),
  addEllipses = TRUE
)
}
\arguments{
\item{data}{Input data for PCA: matrix or data frame.}

\item{is.matrix}{Logical indicating if input is a matrix. Default is TRUE.}

\item{scale}{Logical indicating whether to scale the data. Default is TRUE.}

\item{is.log}{Logical indicating whether to log-transform the data. Default is FALSE.}

\item{pdata}{Data frame with sample IDs and grouping information.}

\item{id_pdata}{Column name in `pdata` for sample IDs. Default is "ID".}

\item{group}{Column name in `pdata` for grouping variable. Default is NULL.}

\item{geom.ind}{Type of geometric representation for points. Default is "point".}

\item{cols}{Color scheme for groups. Default is "normal".}

\item{palette}{Color palette for groups. Default is "jama".}

\item{repel}{Logical indicating whether to repel overlapping points. Default is FALSE.}

\item{ncp}{Number of principal components to retain. Default is 5.}

\item{axes}{Principal components to plot (e.g., c(1, 2)). Default is c(1, 2).}

\item{addEllipses}{Logical indicating whether to add concentration ellipses. Default is TRUE.}
}
\value{
A ggplot object of the PCA plot.
}
\description{
This function performs Principal Component Analysis (PCA) on gene
expression data,
reduces dimensionality while preserving variance, and generates a scatter
plot visualization.
}
\examples{
if (requireNamespace("FactoMineR", quietly = TRUE) &&
  requireNamespace("factoextra", quietly = TRUE)) {
  set.seed(123)
  eset <- matrix(rnorm(1000), nrow = 100, ncol = 10)
  rownames(eset) <- paste0("Gene", 1:100)
  colnames(eset) <- paste0("Sample", 1:10)
  pdata <- data.frame(
    ID = colnames(eset),
    group = rep(c("A", "B"), each = 5)
  )
  iobr_pca(eset, pdata = pdata, id_pdata = "ID", group = "group", addEllipses = FALSE)
}

}
\author{
Dongqiang Zeng
}
