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.
`Here is an example of how one extracts RawData from a string:
> 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"], ...Examples:
> SampleData.eb2 |> RawData.get
Just { columnHeaders = ["x","y"]
, data = [["0","1.0"],["0","0.9"],["1","1.8"],["0","1.0"],["1","2.0"]
,["1","2.2"],["0","1.1"]]
, metadata = [] }
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.