Skip to contents

This function retrieves the remote SHA (Secure Hash Algorithm) reference for one or more specified R packages from their remote repositories. The SHA uniquely identifies the version of a package's source code, useful for reproducibility and version tracking.

Usage

Package_RemoteSha(...)

Arguments

...

Character. Names of one or more R packages (quoted or unquoted) for which to retrieve the remote SHA.

Value

A named character vector where names are the package names and values are the corresponding remote SHAs. If a package is not found or has no remote SHA, the value will be NA.

Details

The function uses pak::lib_status() to query the status of installed packages and extract their remote SHAs. It supports packages installed from GitHub, GitLab, or other remote sources via pak. If a package is installed from CRAN or locally without a remote SHA, the result will be NA.

Author

Ahmed El-Gabbas

Examples

Package_RemoteSha(Hmsc, IASDT.R, "nonexistent")
#>        Hmsc     IASDT.R nonexistent 
#>    "3.0-13"          NA          NA