% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/estimateLCMinfiEwasWater.R
\name{writePhenoLCMinfiEwasWater}
\alias{writePhenoLCMinfiEwasWater}
\title{Write the merged phenotype plus cell-composition table}
\usage{
writePhenoLCMinfiEwasWater(
  lcData,
  file,
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_writePhenoLCMinfiEwasWater.txt"
)
}
\arguments{
\item{lcData}{Object returned by \code{estimateLCMinfiEwasWater()}.}

\item{file}{Character. Path to the CSV file to write.}

\item{verbose}{Logical. If \code{TRUE}, emit progress messages with \code{message()}.}

\item{logs}{Logical. If \code{TRUE}, write the same messages to a log file.}

\item{log_dir}{Character or \code{NULL}. Directory used for the log file when
\code{logs = TRUE}.}

\item{log_file}{Character. File name used when \code{logs = TRUE}.}
}
\value{
Invisibly returns \code{file}.
}
\description{
Write the merged phenotype plus cell-composition table
}
\examples{
ref_file <- system.file("extdata", "saliva.txt", package = "dnaEPICO")
beta <- as.matrix(utils::read.table(ref_file))[1:20, , drop = FALSE]
colnames(beta) <- c("sample1", "sample2")
targets <- data.frame(
    Sample_Name = colnames(beta),
    Timepoint = c("T1", "T2"),
    stringsAsFactors = FALSE
)
lc_data <- estimateLCMinfiEwasWater(
    beta = beta,
    targets = targets,
    lcRef = "saliva",
    phenoOrder = "Sample_Name;Timepoint"
)
output_file <- file.path(tempdir(), "phenoLC.csv")
writePhenoLCMinfiEwasWater(lcData = lc_data, file = output_file)
file.exists(output_file)

}
