% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MakeComDimScoresTable.R
\name{MakeComDimScoresTable}
\alias{MakeComDimScoresTable}
\title{MakeComDimScoresTable}
\usage{
MakeComDimScoresTable(
  model,
  blocks = NULL,
  dim = NULL,
  dim.ort = NULL,
  include = c("Q.scores", "T.scores", "Q.scores.ort", "T.scores.ort")[1:2]
)
}
\arguments{
\item{model}{The output from a ComDim analysis (a \code{ComDim} object).}

\item{blocks}{The blocks from which local scores will be extracted. A vector of integers (block
indices) or block names. When omitted, all blocks are included. Only relevant when
\code{"T.scores"} or \code{"T.scores.ort"} are in \code{include}.}

\item{dim}{Integer vector of predictive component indices to include. When omitted, all
predictive components in the model are included.}

\item{dim.ort}{Integer vector of orthogonal component indices to include. When \code{NULL},
all orthogonal components present in the model are included. When \code{0}, no orthogonal
components are included.}

\item{include}{Character vector selecting which score types to include. Accepted values
(case-insensitive) are \code{"Q.scores"} (global predictive scores),
\code{"T.scores"} (local predictive scores), \code{"Q.scores.ort"} (global orthogonal
scores), and \code{"T.scores.ort"} (local orthogonal scores). Defaults to
\code{c("Q.scores", "T.scores")}.}
}
\value{
A long data frame with one row per sample–component–score-type combination, containing
  the following columns:
  \describe{
    \item{\code{sample.id}}{Sample name (factor).}
    \item{\code{sample.id.number}}{Integer position of the sample (factor).}
    \item{\code{block.id}}{Block index, or \code{"Global"} / \code{"Global.ort"} for Q scores.}
    \item{\code{block.name}}{Block name, or \code{"Global"} / \code{"Global.ort"} for Q scores (factor).}
    \item{\code{dim}}{Component number.}
    \item{\code{scores.type}}{One of \code{"Global"}, \code{"Global.ort"}, \code{"Local"}, or \code{"Local.ort"} (factor).}
    \item{\code{scores.type.dim}}{Concatenation of scores type and component number, e.g. \code{"Q.scores1"} (factor).}
    \item{\code{value}}{Score value.}
  }
}
\description{
Creates a long (tidy) data frame with the global and/or local scores from a ComDim model,
suitable for use with \pkg{ggplot2}.
}
\examples{
b1 <- matrix(rnorm(500), 10, 50) # 10 rows and 50 columns
b2 <- matrix(rnorm(800), 10, 80) # 10 rows and 80 columns
mb <- MultiBlock(Data = list(b1 = b1, b2 = b2))
model <- ComDim_PCA(mb, ndim = 2)
tbl <- MakeComDimScoresTable(model)
}
\seealso{
\code{\link{MakeComDimLoadingsTable}}, \code{\link{ComDim_PCA}}
}
