Open leeper opened 7 years ago
I have uploaded a patched version to github https://github.com/jarjuk/csvy
Please refer to the updated test in https://github.com/jarjuk/csvy/blob/patch-colClasses/tests/testthat/test_csvy.R, which checks that attributes are retained (and also data is read correctly back after an import - the earlier version fails here :)
Please let me know, if I can make the patch better available for the trunk. Disclaimer: I am NOT an R -expert - just learning, and I may have misunderstanding somewhere.
Cheers, Jukka
From an email:
I could not make Date datatype to work as expected. After modifying line 80 on in "R/read_csvy.R"
Date -datatype works as I would expect.
Documentation on https://stat.ethz.ch/R-manual/R-devel/library/base/html/attributes.html says
"Assigning attributes first removes all attributes, then sets any dim attribute and then the remaining attributes in the order given: this ensures that setting a dim attribute always precedes the dimnames attribute."
Is it possible that the original version removes class -attribute, which never gets set anymore?
I have made small test, which fails when running it using the version downloaded with the command "git clone https://github.com/leeper/csvy", and passes after the modification. The test is attached below.