The purpose of the RawData module is to intelligently extract a data table, column headers, and metadata from a string representing data in one of several formats — csv, tab-delimited, or space-delimited. With the second, one can extract a list of Points in the xy plane from a data table.
Empty RawData value
Example:
> import SampleData
> import RawData
> RawData.get SampleData.temperature
Just {
columnHeaders = ["Year","Value"]
, metadata = ["Global Land and Ocean Temperature Anomalies"
,"January-December 1880-2016"
,"Units: Degrees Celsius"
]
, rawData = [["1880","-0.12"],["1881","-0.07"],["1882","-0.08"]
["1883","-0.15"], ...Extracts two columns as a tuple list, usefull when checking for correlation between data.
>RawData.toData 0 1 (Maybe.withDefault (RawData.RawData [] [] [[]]) data) == [(1880,-0.12),(1881,-0.07),(1882,-0.08),(1883,-0.15),(1884,-0.22), ...]Function to extract a column of values from the given data
> firstColumn = RawData.dataToFloatList data 1Compute the minimum of a column in a list of data, e.g.,
minimum xCoord datawhich computes the minimum of the x-values.
Compute the maximum of a column in a list of data, e.g.,
maximum xCoord datawhich computes the maximum of the x-values.
A RawData value consists of metadata, columnHeaders, and data. The first two are lists of strings, while the last is a list of records, where a record is a lest of strings.