Skip to contents

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.

Usage

package_date(pkg = ".", which = "strong")

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.
#> Caching results to be faster next call in this session.
#>                  Published             deps_available 
#> "2019-09-20 07:40:07 CEST" "2019-08-10 22:30:20 CEST" 
package_date("paramtest")
#>                  Published             deps_available 
#>  "2025-03-24 19:50:04 CET" "2024-08-28 13:20:06 CEST" 
package_date("Seurat") # Dependencies on packages not on CRAN
#>                  Published             deps_available 
#> "2025-04-23 22:10:03 CEST" "2025-04-22 19:40:02 CEST" 
package_date("afmToolkit") # Dependency was removed from CRAN
#> Warning: Package's dependencies were archived from CRAN after package publication: minpack.lm
#>                  Published             deps_available 
#> "2017-04-03 15:30:50 CEST" "2017-04-01 22:55:38 CEST"