Search the DESCRIPTION file for the release dates of dependencies and return the earliest date according to CRAN's archive. This is the date at which the package could be installed.
Arguments
- pkg
Path to the package folder or name of the package published.
- which
a character vector listing the types of dependencies, a subset of
c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances")
. Character string"all"
is shorthand for that vector, character string"most"
for the same vector without"Enhances"
, character string"strong"
(default) for the first three elements of that vector.
Value
A vector with the datetimes of the published package (or current date if not published) and the datetime the required restrictions were met.
Details
Currently this function assumes that packages only use ">=" and not other operators. This might change on the future if other operators are more used.
Examples
package_date("ABACUS")
#> Retrieving repos_dependencies, this might take a bit.
#> Next call will be faster.
#> Published deps_available
#> "2019-09-20 07:40:07 CEST" "2019-08-10 22:30:20 CEST"
package_date("paramtest")
#> Published deps_available
#> "2017-10-24 09:43:24 CEST" "2017-07-30 10:08:28 CEST"
package_date("Seurat") # Dependencies on packages not on CRAN
#> Published deps_available
#> "2025-01-24 06:50:07 CET" "2025-01-23 16:40:20 CET"
package_date("afmToolkit") # Dependency was removed from CRAN
#> Warning: Package's dependencies archive were removed from CRAN after package publication: minpack.lm
#> Published deps_available
#> "2017-04-03 15:30:50 CEST" "2017-04-01 22:55:38 CEST"