ropensci / RNeXML

Implementing semantically rich NeXML I/O in R
https://docs.ropensci.org/RNeXML
Other
13 stars 9 forks source link

breaking change introduced in R 4.0.0 #245

Closed cboettig closed 4 years ago

cboettig commented 4 years ago

@hlapp The latest R-devel will introduce stringsAsFactors=FALSE as the new default, which breaks an RNeXML test: https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-clang/RNeXML-00check.html

I think the issue might just be that

https://github.com/ropensci/RNeXML/blob/d03aa5a0a544f173714c703a52b8472fc76cfe04/tests/testthat/test_01_utils.R#L119

needs to explicitly be declared as a factor now? But not quite sure. Here's the message from CRAN:

These can be reproduced by checking with --as-cran using a very current r-devel (r77865 or later), which makes data.frame() and read.table() use a stringsAsFactors = FALSE default, which is planned to become the new default for the upcoming R 4.0.0.

Please see https://developer.r-project.org/Blog/public/2020/02/16/stringsasfactors/index.html for more information about this change.

Can you please fix your package to work with both the old and new default? In principle, this can easily be achieved by adding stringsAsFactors = TRUE to the relevant calls to data.frame() or read.table() [or other read.* function calling read.table()], but please only do this if the sort order used in the string to factor conversion really does not matter (see the blog post about the locale dependence of the conversion). Otherwise, please change to create the factors with explicitly given levels.

The new problems may be from code in a package you depend on: in this case, please let me know, and get in touch with the maintainer of that package.

Please correct before 2020-03-20 to safely retain your package on CRAN.

hlapp commented 4 years ago

Indeed. Just submitted #246.