Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R 4.0.0 will change behavior of poppr() #212

Closed
zkamvar opened this issue Feb 19, 2020 · 0 comments · Fixed by #213
Closed

R 4.0.0 will change behavior of poppr() #212

zkamvar opened this issue Feb 19, 2020 · 0 comments · Fixed by #213

Comments

@zkamvar
Copy link
Member

zkamvar commented Feb 19, 2020

This is entirely related to reconhub/matchmaker#9, but slightly different.

 Current CRAN status: ERROR: 2, OK: 11

Version: 2.8.4
Check: tests
Result: ERROR
     Running 'test-all.R' [18s/19s]
    Running the tests in 'tests/test-all.R' failed.
    Complete output:
     > library(testthat)
     > options(poppr.debug = TRUE)
     > test_check("poppr")
     Loading required package: poppr
     Loading required package: adegenet
     Loading required package: ade4
    
     /// adegenet 2.1.2 is loaded ////////////
    
     > overview: '?adegenet'
     > tutorials/doc/questions: 'adegenetWeb()'
     > bug reports/feature requests: adegenetIssues()
    
    
     This is poppr version 2.8.4. To get started, type package?poppr
     OMP parallel support: available
     -- 1. Failure: poppr returns expected PA values (@test-poppr.R#52) ------------
     `x` not equivalent to `expected`.
     Types not compatible: character is not integer
    
     -- 2. Failure: poppr returns expected codominant values (@test-poppr.R#66) ----
     `x` not equivalent to `expected`.
     Types not compatible: character is not integer
    
     == testthat results ===========================================================
     [ OK: 333 | SKIPPED: 187 | WARNINGS: 0 | FAILED: 2 ]
     1. Failure: poppr returns expected PA values (@test-poppr.R#52)
     2. Failure: poppr returns expected codominant values (@test-poppr.R#66)
    
     Error: testthat unit tests failed
     Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 2.8.4
Check: whether package can be installed
Result: ERROR
    Installation failed.
Flavor: r-release-windows-ix86+x86_64 

The issue is due to the fact that Zhian from 2012-2016 did not think to set stringsAsFactors = FALSE when constructing the poppr table and here we are.

The solution to this is unlike that of reconhub/matchmaker#9 where we can simply update the tests, it's explicitly changing the output. The question then becomes stringsAsFactors = TRUE or stringsAsFactors = FALSE? The former gives backwards compatibility, but is not reproducible (see stringsAsFactors = HELLNO) while the latter moves forward with the times, but breaks backwards compatibility to a small degree. I'm leaning towards stringsAsFactors = FALSE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant