This function checks if a package exists on CRAN and retrieves the corresponding package URL and version details. If a specific version is not provided, the latest version is used.
Value
A list with one of the following structures:
- package_url
Character string; the URL to download the package tarball.
- last_version
A named list with
versionanddatefor the latest available version.- version
Character string; the requested version (or
NULLif not specified).- all_versions
A list of named lists, each with
versionanddate, representing all available versions.
Examples
if (FALSE) { # \dontrun{
# Check and fetch a specific version of "ggplot2"
result <- check_and_fetch_cran_package("ggplot2", package_version = "3.3.5")
print(result)
} # }
