Skip to content
Prev 9696 / 12125 Next

[R-pkg-devel] Question regarding listing base and recommended packages programmatically and efficiently

On Sat, Oct 14, 2023 at 5:25?AM Martin Maechler
<maechler at stat.math.ethz.ch> wrote:
Excellent. Will it be supported on all OSes?  Because, there's
currently a source code comment saying the current implementation
might not work on MS Windows:

## we cannot assume that file.path(R.home("share"), "make", "vars.mk")
## is installed, as it is not on Windows
standard_package_names <-
.get_standard_package_names <-
local({
    lines <- readLines(file.path(R.home("share"), "make", "vars.mk"))
    lines <- grep("^R_PKGS_[[:upper:]]+ *=", lines, value = TRUE)
    out <- strsplit(sub("^R_PKGS_[[:upper:]]+ *= *", "", lines), " +")
    names(out) <-
        tolower(sub("^R_PKGS_([[:upper:]]+) *=.*", "\\1", lines))
    eval(substitute(function() {out}, list(out=out)), envir = topenv())
    })

/Henrik