\encoding{UTF-8}
\name{write_kbase}
\alias{write_kbase}
\title{Write a base file}

\description{
  Write a base to
  a file. The file formats are described in the \link{kstIO-package}
  information page.
}

\usage{
  write_kbase(x, 
              filename, 
              format = NULL,
              sep = ',',
              enforce = TRUE)
}

\arguments{
  \item{x}{The data to be written, either a binary matrix or an object
    of \code{kbase} class.}
  \item{filename}{A character string specifying the name of the base file.}
  \item{format}{Specification of the files format. Can be "SRBT", "KST", 
    "CSV", "matrix" or sprreadsheet formats.}
  \item{sep}{Cell separator for CSV files.}
  \item{enforce}{Enforce basis porperties? [Default is TRUE]}
}

\references{
  Hockemeyer, C. (2001). \emph{KST Tools User Manual} (2nd ed.). 
  \url{https://resources.cord-hockemeyer.info/techreports/KST-Tools_TechRep_FWF01.pdf}.

  Poetzi, S. & Wesiak, G. (2001). \emph{SRbT Tools User Manual.}
  \url{https://resources.cord-hockemeyer.info/techreports/SRBT-Tools_TechRep_FWF01.pdf}
}

\author{Cord Hockemeyer \email{cord.hockemeyer@uni-graz.at}}

\seealso{\code{\link[kst]{kbase}},
	 \link{kstIO-package}
}

\examples{
d <- getwd()
setwd(tempdir())
# Write base to file
write_kbase(phsg$basis, "phsg.bas") # Write in SRBT format
write_kbase(phsg$basis, "phsg.xlsx") # XLSX format
setwd(d)
}

\keyword{file}
