/*
	Minimal application that reads variables containing numbers from a file
    and then calculates descriptive statistics
	lobsterman 01/04/24
*/

import JavaGrinders.*;

public class DataHandlingDemo1 {

	public static void main(String args[]) {
	try {
        // define and contruct a Parser for a DataFile with a given name.
        // Note, for this to work you need to place this file in the same
        // harddisk directory as your project. If no name is provided then
        // a standard filechooser dialog box will pop up allowing you to
        // select a file from your hard disk.
        DataFileParser myParser = new DataFileParser("../../DataFiles/Test.txt");
        // define variables without a VariableOrganizer
        integerVariable theInts = new integerVariable("xInteger",null);
        numberVariable theDoubles = new numberVariable("yDouble",null);
        // now fill them with data from the internal array of the Parser 
        theInts.fillWithParser(myParser,0);
        theDoubles.fillWithParser(myParser,1);
        // list descriptive stats for the variables
        theInts.listDescriptives(null);
        theDoubles.listDescriptives(null);
	} catch (Exception e) { System.err.println(e); }
	}
}
