Closed
Description
Many non-US csv's use ";" as separators and "," as decimal markers. Call these "type-2" csv's. In R there are two functions: read_csv() for regular US-style, and read_csv2() for type-2.
Currently one needs to do something like the code below in order read type-2 csv (available on Observable here):
parseColon = v => parseFloat(v.replace(",","."));
table = aq.loadCSV('type2.csv', // could be aq.fromCSV() as well
{ delimiter: ";", parse : { col1: parseColon, col2: parseColon } })
so my suggestion is smtg like the above gets wrapped into aq.loadCSV2() and aq.fromCSV2(). It will avoid much rework. Also notice one would not need to list which numeric columns need to be parsed with "parseColon". This logic would be internalized. If a column is deemed numeric, apply the right parsing.
alternatively, you can add "decimal_marker" to the option object in loadCSV() and fromCSV(), defaulting to ".". so the new code would look like
table = aq.loadCSV('type2.csv', // could be aq.fromCSV() as well
{ delimiter: ";", decimal_marker: ',' });