Every R programmer knows CRAN – the repository for R packages. It has strict guidelines for submitted packages and stores all previously submitted versions, so the submission cycle cannot be too short (as opposed to commits in version control systems).
Packages
There are more than 20’000 packages on CRAN already (numbers as of
January 2025). To list them all within the woodendesc framework the user
should use wood_cran_packages()
.
wood_cran_packages() |>
# There are way to many packages to simply show them all
print(max = 15)
#> [1] "A3" "AalenJohansen" "AATtools" "ABACUS"
#> [5] "abasequence" "abbreviate" "abc" "abc.data"
#> [9] "ABC.RAP" "ABCanalysis" "abclass" "ABCoptim"
#> [13] "abcrf" "abcrlda" "abctools"
#> [ reached getOption("max.print") -- omitted 21921 entries ]
Available package versions
To list all package versions submitted and accepted to CRAN the user
should use wood_cran_versions()
.
wood_cran_versions("versionsort")
#> [1] "1.0.0" "1.1.0"
Latest package version
To query the latest package version, i.e. the one that’d be installed
by calling install.packages()
, the user should use
wood_cran_latest()
. The returned value is equivalent to
selecting the latest version from wood_cran_versions()
.
wood_cran_latest("versionsort")
#> [1] "1.1.0"
wood_cran_versions("versionsort") |>
versionsort::ver_latest()
#> [1] "1.1.0"
Package dependencies
To list package dependencies the user should use
wood_cran_dependencies()
. This function extracts
dependencies from the DESCRIPTION
file. By default the
latest version is inspected (the same behaviour can be obtained using
version = "latest"
parameter) but it is possible to list
dependencies for any previous version as well.
wood_cran_dependencies("deepdep")
#> <dependencies>
#> Depends: R (>= 3.2.0)
#> Imports: cranlogs
#> Imports: httr
#> Imports: jsonlite
#> Suggests: BiocManager
#> Suggests: covr
#> Suggests: devtools
#> Suggests: ggplot2
#> Suggests: ggraph
#> Suggests: graphlayouts
#> Suggests: igraph
#> Suggests: knitr
#> Suggests: miniCRAN
#> Suggests: plyr
#> Suggests: rmarkdown
#> Suggests: scales
#> Suggests: shiny
#> Suggests: shinycssloaders
#> Suggests: spelling
#> Suggests: stringi
#> Suggests: testthat (>= 2.1.0)
#> Suggests: vcr
wood_cran_dependencies("deepdep", version = "0.2.0")
#> <dependencies>
#> Depends: R (>= 3.2.0)
#> Imports: cranlogs
#> Imports: ggforce
#> Imports: ggplot2
#> Imports: ggraph
#> Imports: graphlayouts
#> Imports: httr
#> Imports: igraph
#> Imports: jsonlite
#> Imports: scales
#> Suggests: BiocManager
#> Suggests: shiny
#> Suggests: shinycssloaders
#> Suggests: covr
#> Suggests: devtools
#> Suggests: knitr
#> Suggests: miniCRAN
#> Suggests: plyr
#> Suggests: rmarkdown
#> Suggests: spelling
#> Suggests: stringi
#> Suggests: testthat (>= 2.1.0)