Class DataWriter

java.lang.Object
edu.cmu.tetrad.data.DataWriter

public final class DataWriter extends Object
Provides static methods for saving data to files.
Author:
josephramsey
  • Constructor Details

    • DataWriter

      public DataWriter()
  • 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 that out is not closed by this method, so the close method on out will 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

      public static void writeCovMatrix(ICovarianceMatrix covMatrix, PrintWriter out, NumberFormat nf)
      Writes the lower triangle of a covariance matrix to file. Note that out is not closed by this method, so the close method on out will need to be called externally.
      Parameters:
      out - The writer to write the output to.
    • saveKnowledge

      public static void saveKnowledge(Knowledge knowledge, Writer out) throws IOException
      Throws:
      IOException