Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upThis makes the scripts executable on a fresh R installation. #42
Conversation
|
About to go for a (belated) run and will clean the commit up a little later. These days the recommended idiom is if (!requireNamespace("somepackage", quietly=TRUE) doSomethingHere()It is a matter of taste if make scripts install their requirements. I used to do it a little more ~20 years ago, I now find it (mostly) redundant as we a) do work with packages anyway and b) packages take care of this. It is definitely useful for optional packages having a Lastly, compulsory advertisement: You want probably want littler to give you |
| @@ -26,6 +26,10 @@ QCon](http://www.youtube.com/watch?v=wlvKAT7SZIQ) (voted best talk). | |||
| ### Example | |||
|
|
|||
| ```r | |||
| if (!require("RcppSimdJson")) install.packages("RcppSimdJson") | |||
eddelbuettel
Jul 16, 2020
Owner
On balance, no.
In a README.md conciseness trumps completeness. It is also the top-level README for the package. We will assume people can install it.
On balance, no.
In a README.md conciseness trumps completeness. It is also the top-level README for the package. We will assume people can install it.
|
|
||
| if (!require("microbenchmark")) install.packages("microbenchmark") |
eddelbuettel
Jul 16, 2020
Owner
Or simply a stopifnot() which now has customizable errors.
Auto-installation is no panacea either as not every user will have a compiler.
Or simply a stopifnot() which now has customizable errors.
Auto-installation is no panacea either as not every user will have a compiler.
| if (!require("jsonlite")) install.packages("jsonlite") | ||
| if (!require("RcppSimdJson")) install.packages("RcppSimdJson") | ||
| if (!require("ndjson")) install.packages("ndjson") | ||
| if (!require("RJSONIO")) install.packages("RJSONIO") |
eddelbuettel
Jul 16, 2020
Owner
This makes some sense here and I will clean that up later.
This makes some sense here and I will clean that up later.
|
This PR can be thrown away without hurting my feelings at all. ;-) |
|
I added a small amount of spit and polish. Let me know what you think. |
|
I think that this is much better!!! I recommend merging this. |
This may not be a good idea, but for someone like myself who only use R from time-to-time, and often on a fresh R setup, having self-contained scripts that install their own dependencies is quality-of-life issue.