% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/readPhenotypeTargets.R
\name{readPhenotypeTargets}
\alias{readPhenotypeTargets}
\title{Read phenotype targets for shared dnaEPICO workflows}
\usage{
readPhenotypeTargets(
  phenoFile,
  sepType = NULL,
  nSamples = NA,
  SampleID = "Sample_Name",
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_readPhenotypeTargets.txt"
)
}
\arguments{
\item{phenoFile}{Character. Path to the phenotype table on disk.}

\item{sepType}{Character or \code{NULL}. Field separator used in \code{phenoFile}. Use
\code{NULL} for a standard comma-separated file, \code{'\\\\t'} for a tab-delimited
file, or another single-character separator accepted by \code{utils::read.csv()}.}

\item{nSamples}{Integer or \code{NA}. Number of rows to keep from the start of the
phenotype table. The default \code{NA} reads and returns all rows.}

\item{SampleID}{Character. Name of the column containing sample identifiers
that will later be used to name methylation-array samples.}

\item{verbose}{Logical. If \code{TRUE}, emit progress and preview messages with
\code{message()}. The default is \code{FALSE}, so the function is quiet unless the
user explicitly requests messages.}

\item{logs}{Logical. If \code{TRUE}, write the same progress messages to a log
file. The default is \code{FALSE}.}

\item{log_dir}{Character or \code{NULL}. Directory where the log file should be
written when \code{logs = TRUE}. If \code{NULL}, the current working directory is
used.}

\item{log_file}{Character. File name used when \code{logs = TRUE}. The default is
\code{'log_readPhenotypeTargets.txt'}.}
}
\value{
A \code{data.frame} containing the phenotype targets.
}
\description{
Read the phenotype table used by shared \code{dnaEPICO} workflows, validate the
sample identifier column, optionally subset the first \code{nSamples}, and return
the targets as a base \code{data.frame}.
}
\examples{
tmp <- tempdir()
pheno <- data.frame(
    Sample_Name = c("S1", "S2"),
    Sex = c("F", "M"),
    stringsAsFactors = FALSE
)
pheno_file <- file.path(tmp, "pheno.csv")
utils::write.csv(pheno, pheno_file, row.names = FALSE)
targets <- readPhenotypeTargets(
    phenoFile = pheno_file,
    SampleID = "Sample_Name"
)
stopifnot(is.data.frame(targets))
stopifnot(nrow(targets) == 2L)

}
