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 dependency (stringsAsFactors) #375

Closed
MichaelChirico opened this issue Jan 11, 2022 · 3 comments
Closed

R 4.0 dependency (stringsAsFactors) #375

MichaelChirico opened this issue Jan 11, 2022 · 3 comments
Assignees
Labels

Comments

@MichaelChirico
Copy link
Contributor

The stated R dependency is quite old:

Depends: R (>= 2.14.0)

But this code relies on the default behavior of as.data.frame()'s stringsAsFactors = FALSE in R 4.0 and later:

Xint <- as.list(as.data.frame(t(expand.grid(Xmatch))))

@nhejazi
Copy link
Member

nhejazi commented Jan 27, 2022

Thanks for bringing this up, it's a good find. I wasn't aware of changes to as.data.frame()'s default behavior, but it looks like as.data.table() has a stringsAsFactors argument that defaults to FALSE, and the data.table package is backwards compatible with R 3.1.0+, so I think it will suffice to update the minimum R version of sl3 to match with that used by data.table (although in practice other dependencies will determine the limit) and to switch out that particular use of as.data.frame() with as.data.table(). I'll do that in a PR shortly.

@nhejazi nhejazi self-assigned this Jan 27, 2022
@nhejazi nhejazi added the bug label Jan 27, 2022
@MichaelChirico
Copy link
Contributor Author

yep, that'll work. thanks!

@nhejazi
Copy link
Member

nhejazi commented Jan 28, 2022

resolved by #378

@nhejazi nhejazi closed this as completed Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants