Skip to content
New issue

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

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

Already on GitHub? # to your account

Function for specifying minimum R version #1619

Closed
JosiahParry opened this issue Apr 4, 2022 · 9 comments
Closed

Function for specifying minimum R version #1619

JosiahParry opened this issue Apr 4, 2022 · 9 comments

Comments

@JosiahParry
Copy link
Contributor

I am presently writing a package utilizing the native pipe. As such, I would like to specify the minimum R version as 4.1. I was hoping to be able to do this via usethis as I do not know how to format this in a DESCRIPTION file.

I see that there is a tangential closed issue at #631. My suggestion, however, is not to infer it from use_data() but rather be something stated explicitly by the developer themselves. It could, however, be inferred that R v4.1+ is necessary when the native pipe is used.

@malcolmbarrett
Copy link
Collaborator

You mean like use_package("R", type = "Depends", min_version = "4.1.0")?

I don't think this is off-label but don't quote me on that.

@jennybc assuming this is kosher, we still warn about adding something to depends instead of imports, which doesn't apply to this case

@JosiahParry
Copy link
Contributor Author

That would be helpful! I was unaware I could use use_package() to add to depends. Then the use of min_version would satisfy.

@malcolmbarrett
Copy link
Collaborator

Sorry, I made it sound like a proposal rather than a solution. That code works out of box & is what I do, for better or worse

@jennybc
Copy link
Member

jennybc commented Apr 4, 2022

Yeah the use_package() approach shown by @malcolmbarrett is the intended way, if you want to use usethis to do this. It's not something that comes up nearly as often as the main use_package() usage.

@jennybc jennybc closed this as completed Apr 4, 2022
@JosiahParry
Copy link
Contributor Author

Good to know! Thanks :)

@JosiahParry
Copy link
Contributor Author

In light of the new check for R 4.1 incompatibilities in R-devel, it would be quite nice to have to a way to set the minimum version of R. I can never quite remember how to do it and come back to this issue every few months or so.

@malcolmbarrett
Copy link
Collaborator

malcolmbarrett commented Feb 7, 2025

Doesn't this solution still work? Or do you mean it's just hard to remember

@JosiahParry
Copy link
Contributor Author

It definitely still works! Its just exceptionally difficult to remember how to do it and then quite tough to find this issue

My search history trying to get here Image

@kbvernon
Copy link

Just came across this myself and share the confusion. The proposed solution - treating R like an R package - has the feel of a hidden Konami Code. In terms of demand, I would think it would come up about as often as other one-off package development utilities, like use_mit_license().

Just my two cents, for whatever that's worth...

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

No branches or pull requests

4 participants