Package edu.cmu.tetrad.data
Class DataWriter
java.lang.Object
edu.cmu.tetrad.data.DataWriter
Provides static methods for saving data to files.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidsaveKnowledge(Knowledge knowledge, Writer out) saveKnowledge.static voidwriteCovMatrix(ICovarianceMatrix covMatrix, PrintWriter out, NumberFormat nf) Writes the lower triangle of a covariance matrix to file.static voidwriteRectangularData(DataSet dataSet, Writer out, char separator) Writes a dataset to file.
-
Method Details
-
writeRectangularData
public static void writeRectangularData(DataSet dataSet, Writer out, char separator) throws IOException Writes a dataset to file. The dataset may have continuous and/or discrete columns. Note thatoutis not closed by this method, so the close method onoutwill need to be called externally.- Parameters:
dataSet- The data set to save.out- The writer to write the output to.separator- The character separating fields, usually '\t' or ','.- Throws:
IOException- If there is some problem dealing with the writer.
-
writeCovMatrix
Writes the lower triangle of a covariance matrix to file. Note thatoutis not closed by this method, so the close method onoutwill need to be called externally.- Parameters:
covMatrix- aICovarianceMatrixobjectout- The writer to write the output to.nf- aNumberFormatobject
-
saveKnowledge
saveKnowledge.
- Parameters:
knowledge- aKnowledgeobjectout- aWriterobject- Throws:
IOException- if any.
-