'Retrieving all releases for a specific R package
What are available r tools to obtain list of all releases for a specific R CRAN package.
There is expected to retrieve at least Dates each package version was released.
Other metadata for each package are in value too.
- self-promotion of my new CRAN package https://CRAN.R-project.org/package=pacs
Solution 1:[1]
TL;DR
- pacs::pac_timemachine
- pkgsearch::cran_package_history
- pkgdown:::pkg_timeline (non-exported and only Date of publish)
pacs::pac_timemachine in pacs package.
pacs::pac_timemachine is using CRAN website or crandb.
head(pacs::pac_timemachine("tidyr"), 3)
#> Package Version Released Archived LifeDuration
#> 2 tidyr 0.1 2014-07-21 2015-09-08 414 days
#> 3 tidyr 0.2.0 2015-09-08 2015-09-08 0 days
#> 4 tidyr 0.3.0 2015-09-08 2015-09-10 2 days
#> URL Size
#> 2 Archive/tidyr/tidyr_0.1.tar.gz 134K
#> 3 Archive/tidyr/tidyr_0.2.0.tar.gz 139K
#> 4 Archive/tidyr/tidyr_0.3.0.tar.gz 147K
tail(pacs::pac_timemachine("tidyr"), 3)
#> Package Version Released Archived LifeDuration
#> 25 tidyr 1.1.1 2020-07-31 2020-08-27 27 days
#> 26 tidyr 1.1.2 2020-08-27 2021-03-03 188 days
#> 1 tidyr 1.1.3 2021-03-03 <NA> 192 days
#> URL Size
#> 25 Archive/tidyr/tidyr_1.1.1.tar.gz 859K
#> 26 Archive/tidyr/tidyr_1.1.2.tar.gz 861K
#> 1 tidyr_1.1.3.tar.gz <NA>
We could get the result for certain Date or Date interval or version too.
pacs::pac_timemachine("tidyr", at = as.Date("2018-01-01"))
pacs::pac_timemachine("tidyr", version = "1.0.0")
pacs::pac_timemachine("tidyr", from = as.Date("2020-06-01"), to = as.Date("2020-08-01"))
Created on 2021-09-11 by the reprex package (v2.0.1)
the pkgsearch package.
This one is builded under private DB which is systematically appended with new DESCRIPTION files for each CRAN package.
head(pkgsearch::cran_package_history("tidyr"), 3)
#> # A tibble: 3 × 25
#> Package Title Version `Authors@R` Description License LazyData URL
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 tidyr Easily … 0.1 "'Hadley Wick… tidyr is an e… MIT + … true https…
#> 2 tidyr Easily … 0.2.0 "as.person(c(… An evolution … MIT + … true https…
#> 3 tidyr Easily … 0.3.0 "c(<U+000a>pe… An evolution … MIT + … true https…
#> # … with 17 more variables: VignetteBuilder <chr>, Packaged <chr>,
#> # Author <chr>, Maintainer <chr>, NeedsCompilation <chr>, Repository <chr>,
#> # Date/Publication <chr>, crandb_file_date <chr>, date <chr>,
#> # dependencies <list>, BugReports <chr>, RoxygenNote <chr>, Remotes <chr>,
#> # MD5sum <chr>, Encoding <chr>, SystemRequirements <chr>,
#> # Config/testthat/edition <chr>
tail(pkgsearch::cran_package_history("tidyr"), 3)
#> # A tibble: 3 × 25
#> Package Title Version `Authors@R` Description License LazyData URL
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 tidyr Tidy Messy Data 1.1.1 "\nc(perso… "Tools to … MIT + … true http…
#> 2 tidyr Tidy Messy Data 1.1.2 "\nc(perso… "Tools to … MIT + … true http…
#> 3 tidyr Tidy Messy Data 1.1.3 "\nc(perso… "Tools to … MIT + … true http…
#> # … with 17 more variables: VignetteBuilder <chr>, Packaged <chr>,
#> # Author <chr>, Maintainer <chr>, NeedsCompilation <chr>, Repository <chr>,
#> # Date/Publication <chr>, crandb_file_date <chr>, date <chr>,
#> # dependencies <list>, BugReports <chr>, RoxygenNote <chr>, Remotes <chr>,
#> # MD5sum <chr>, Encoding <chr>, SystemRequirements <chr>,
#> # Config/testthat/edition <chr>
Created on 2021-09-11 by the reprex package (v2.0.1)
pkgdown package
pkgdown:::pkg_timeline function in pkgdown package. It is a non-exported function so sb have to take that into account. It returns only Date when each package version was published.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
