I tend to be rather explicit than the implicit code that I write. Therefore, after I managed to create my own packages, the next thing that immediately comes to my mind is how to best ensure the reliability and reliability of my code. This is partly due to the packages my package depends on.
Actual question
In this regard: is it possible to explicitly indicate which version of the package dependency is required / desirable?
I am looking for ways that do not require specifying the actual path to, say, a zip file (which, of course, will be easily possible), but just use install.packages "standard behavior" specifying the package name only (possibly with some reference to the required version) .
Due dilligence
I checked Writing R-Extensions to find out what my options are for the Depends section of the DESCRIPTION file hoping for a similar mechanism that works to indicate the required version of R (for example, R (>= 2.15.2) ). But I did not find anything like this for package dependencies:
The Dependencies field gives a list of package names, separated by commas, on which this package depends. The package name may optionally be followed by a comment in parentheses. The comment must contain a comparison operator, a space, and a valid version number.
You can also use the special package name "R" if your package depends on a specific version of R - for example, if the package only works with R version 2.11.0 or later, include "R (> = 2.11.0) in the Dependencies box You may also require some SVN revision for the R-dev or R-fix, for example. "R (> = 2.14.0), R (> = r56550) requires a version later than R-devel at the end of July 2011 (including released versions 2.14.0). This library uses tools for checking libraries and R-packages. Therefore, it is a mistake to use the wrong syntax or the incorrect use of the "Dependencies" field for comments on other software that may be required. Other dependencies (external to the R system) should be listed in the "SystemRequirements" field, possibly reinforced in a separate README file.
R INSTALL settings check whether the R version is used enough for the installed package, and the list of specified packages will be attached (after checking the version requirements) before the current package, as when calling the library and preparing for lazy loading during installation.
Then I also looked at a install.packages and was hoping for something like the version argument, but I think not.
Renouncement
I understand very well that the purpose of my questions may contradict the R-philosophy of distributing and installing packages through the CRAN package repositories, where (at least I think) new versions of certain packages simply βcancelβ previous ones and install.packages() always gets the latest affordable. It is also very important to hide the features of the version from the end user so as not to make things too complicated.
However, with regard to the purpose of writing as reliable code, perhaps IMHO also makes sense to clearly state things. Or at least be able to do this.
Rappster
source share