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

Fix ‘copy_classes’ for older R releases #9

Closed
bgreenwell opened this issue Jan 31, 2020 · 1 comment
Closed

Fix ‘copy_classes’ for older R releases #9

bgreenwell opened this issue Jan 31, 2020 · 1 comment

Comments

@bgreenwell
Copy link
Owner

See current status of tests: https://cran.r-project.org/web/checks/check_results_fastshap.html

@bgreenwell
Copy link
Owner Author

bgreenwell commented Feb 1, 2020

Issue seems related to this PR (which was patched in R 3.6.0): https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17548

Essentially, as.matrix.data.frame() coerces TRUE -> " TRUE" whenever FALSE is also present. Consequently, coercing " TRUE" back to logical using as.logical() results an NA, as opposed to TRUE. Simple fix would be to add

x[[name]] <- if(getRversion() <= "3.6.0") {
  as.logical(trimws(x[[name]]))
} else {
  as.logical(x[[name]])
}

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

No branches or pull requests

1 participant