% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/combine_pd_eset.R
\name{combine_pd_eset}
\alias{combine_pd_eset}
\title{Combine Phenotype Data and Expression Set}
\usage{
combine_pd_eset(
  eset,
  pdata,
  id_pdata = "ID",
  feas = NULL,
  feature_manipulation = TRUE,
  scale = TRUE,
  choose_who_when_duplicate = c("eset", "pdata")
)
}
\arguments{
\item{eset}{Expression matrix with genes/features in rows and samples in
columns.}

\item{pdata}{Data frame containing phenotype/clinical data.}

\item{id_pdata}{Character string specifying the column name in `pdata`
containing sample identifiers. Default is `"ID"`.}

\item{feas}{Character vector specifying features to include from `eset`.
If `NULL`, all features are used. Default is `NULL`.}

\item{feature_manipulation}{Logical indicating whether to apply feature
manipulation to filter valid features. Default is `TRUE`.}

\item{scale}{Logical indicating whether to scale (standardize) expression
data. Default is `TRUE`.}

\item{choose_who_when_duplicate}{Character string specifying which data to
prefer when duplicate columns exist. Options are `"eset"` or `"pdata"`.
Default is `"eset"`.}
}
\value{
Data frame combining phenotype data and (transposed) expression data,
  with samples in rows and features/phenotypes in columns.
}
\description{
Merges phenotype data with an expression matrix by matching sample IDs.
Optionally filters features, applies feature manipulation, and scales
expression data before combining.
}
\examples{
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),
  age = rnorm(10, 50, 10)
)
result <- combine_pd_eset(eset = eset, pdata = pdata, scale = FALSE)
dim(result)
}
\author{
Dongqiang Zeng
}
