\encoding{UTF-8}
\name{write_kfamset}
\alias{write_kfamset}
\title{Write a family of sets to a file}

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

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

\arguments{
  \item{x}{The data to be written, either a binary matrix as \code{kmfamset} object or an object
    of \code{kfamset} class.}
  \item{filename}{A character string specifying the name of the famset file.}
  \item{format}{Specification of the files format. Can be "KST", matrix, "CSV", 
    "ODS", or "XLSX".
  }
  \item{sep}{Cell eparator for CSV files.}
  \item{enforce}{Enforce Famset properties? [Default is TRUE]}
}

\details{
  The \code{format} values refer to the different generations of file formats 
  described in \link{kstIO-package}.  
}

\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{\link{kstIO-package}}

\examples{
# Obtain data to write from the 'pks' package
d <- getwd()
setwd(tempdir())
# Write famset to file
write_kfamset(phsg$basis, "phsg.fs") # Write in KST format
write_kfamset(phsg$basis, "phsg.ods") # Write the matrix in ODS format
setwd(d)
}

\keyword{file}
