GitHub is a site offering Git version control system. It’s the most popular website for hosting open-source R packages, including this one. A wide set of metadata is available.
Packages
A user or an organization may be (and in most cases is) an owner of
several repositories. Not all repositories are R packages, thus the
repository character is approximated by the presence of a
DESCRIPTION
file, one of very few required files for R
packages, in the root folder.
wood_github_packages("turtletopia")
#> [1] "aurrera" "gglgbtq" "ggpizza" "openaccess" "versionsort"
#> [6] "woodendesc"
By default, forks of other repositories are not listed, but this
setting can be changed using include_forks
parameter:
wood_github_packages("ErdaradunGaztea", include_forks = TRUE)
#> [1] "AmyloGraph" "attachment"
#> [3] "fuzzydf" "httptest"
#> [5] "icecream" "nsyllable"
#> [7] "pkgsearch" "playOmics"
#> [9] "Rwclust" "Shen-sq-similarity-kernel"
#> [11] "shinyscreenshot" "tinystring"
Available tags
GitHub allows referencing to certain commits through specifying tags
associated with them. To list all tags available for a given repository
the user should use wood_github_tags()
. Note that some
repositories may not have any tags defined, in which case an empty
character vector would be returned.
wood_github_tags("gglgbtq", "turtletopia")
#> [1] "v0.2.0" "v0.1.1" "v0.1.0"
Available package versions
Repository tags do not have to follow the specific guidelines of
version codes. To extract package version codes associated with each
GitHub tag the user should use wood_github_versions()
. This
extracts the data from the DESCRIPTION
file corresponding
to each tagged commit.
wood_github_versions("versionsort", "turtletopia")
#> [1] "1.1.0" "1.0.0"
Latest package version
To query the latest package version, i.e. the one that’d be installed
by calling remotes::install_github()
, the user should use
wood_github_latest()
. This function queries GitHub for the
version code associated with the latest commit to the default branch of
the specified repository. Note that this commit may be untagged, in
which case the returned version code may not be among the ones listed by
wood_github_versions()
.
wood_github_latest("gglgbtq", "turtletopia")
#> [1] "0.2.0"
Package dependencies
To list package dependencies the user should use
wood_github_dependencies()
. This function extracts
dependencies from the DESCRIPTION
file. By default the
latest commit is queried (the same behaviour can be obtained using
tag = "latest"
parameter) but it is possible to list
dependencies for any tagged version.
wood_github_dependencies("gglgbtq", "turtletopia")
#> <dependencies>
#> Depends: R (>= 2.10)
#> Imports: ggplot2 (>= 3.4.0)
#> Imports: graphics
#> Imports: grDevices
#> Imports: rlang
#> Imports: tibble
#> Suggests: knitr
#> Suggests: rmarkdown
#> Suggests: spelling
#> Suggests: testthat (>= 3.0.0)
#> Suggests: vdiffr
wood_github_dependencies("versionsort", "turtletopia", tag = "v1.0.0")
#> <dependencies>
#> Suggests: covr
#> Suggests: spelling
#> Suggests: testthat (>= 3.0.0)