Closed wincowgerDEV closed 8 months ago
I think we would want to update the read_spec.R file to add support for these types of csv files. Perhaps updating the read_text function would be the best place to implement the support. https://github.com/wincowgerDEV/OpenSpecy/blob/main/R/read_spec.R
Right now the read_text function is being referenced in the shiny app too so that would automatically make it implemented in the shiny app if we can just get read_text to read in french formatted csv and other csv files: https://github.com/wincowgerDEV/OpenSpecy/blob/92c72594abaaf91925d7c0550e791de5a149192d/inst/shiny/server.R#L160
It's actually already there. read_text()
is just a wrapper around whatever read function you pass through the "method" argument and the respective ... options. So read_text(file, method = "read.csv2")
should work out of the box, does it?
What bothers me more is that ton of different ways of formatting a .csv file. It'll be quite difficult and error-prone to make OpenSpecy detect them all automatically. Instead, we may consider adding some additional dropdowns popping up if reading a csv failed. This could also be a permanent cog named "advanced import" or so. With that, the user could specify the preferred method (fread
, read.csv2
, read.csv
), the column separator (sep
), and the decimal (dec
).
Good point. It will be a haul to figure out how to interpret all out of the box. I wish there was some function that already does that. I do like the idea of adding an advanced import option. We could also add binary specifications there to allow for all those weird binary formats to be uploaded.
On Mon, Sep 6, 2021 at 8:25 AM Zacharias Steinmetz @.***> wrote:
It's actually already there. read_text() is just a wrapper around whatever read function you pass through the "method" argument and the respective ... options. So read_text(file, method = "read.csv2") should work out of the box, does it?
What bothers me more is that ton of different ways of formatting a .csv file. It'll be quite difficult and error-prone to make OpenSpecy detect them all automatically. Instead, we may consider adding some additional dropdowns popping up if reading a csv failed. This could also be a permanent cog named "advanced import" or so. With that, the user could specify the preferred method (fread, read.csv2, read.csv), the column separator (sep), and the decimal (dec).
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wincowgerDEV/OpenSpecy/issues/97#issuecomment-913727306, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGMUJU7COV2OSIHPEGP5CWLUATMQDANCNFSM5DMOGPGA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
--
·.¸¸.·´¯
·.´¯·.¸¸.·´¯
ツ ------------------------------Win Cowger, PhD Pronouns: he/him Research Scientist Moore Institute for Plastic Pollution Research
Contact Info
515-298-3869 | @.*** | @Win_OpenData https://twitter.com/Win_OpenData
I think this is fixed now with the current read_text implementation.
Dr. Dehaut proposed some strategies for adding support for french csv files example file below: Basically, French format for csv files are ‘,’ for decimal and ‘;’ for column separation. Use the read.csv2(data, header=T) function, and it makes the job.
Example.csv