% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/PM_data.R
\name{PMwriteMatrix}
\alias{PMwriteMatrix}
\title{Write a Pmetrics .csv Matrix File}
\usage{
PMwriteMatrix(
  data,
  filename,
  override = FALSE,
  version = "DEC_11",
  header = FALSE
)
}
\arguments{
\item{data}{Must be a data.frame with appropriate structure (see \link{PMcheck}).}

\item{filename}{Name of file to create.}

\item{override}{Boolean operator to write even if errors are detected.  Default is \code{FALSE}.}

\item{version}{Which matrix data format version to write.  Default is the current version.}

\item{header}{Is there a header row? Default is \code{FALSE} as this was the legacy format.}
}
\value{
Returns the error report (see \link{PMcheck} for details).
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}}

This function is largely superseded as the function is accessed with
the \verb{$save()} method for \link{PM_data} objects. There is rarely a need to call
it directly. It is the companion function to \link{PMreadMatrix}.
It will write an appropriate R data object to a formatted .csv file.
}
\details{
\emph{PMwriteMatrix} will first run \link{PMcheck} to determine
if there are any errors in the structure of \code{data}.  If the error check
fails, the file will not be written and a message will be printed on the console.
}
\examples{
\dontrun{
# write to the current directory
NPex$data$save("data.csv")
}
}
\seealso{
\link{PM_data}, \link{PMcheck}, \link{PMreadMatrix}
}
\author{
Michael Neely
}
