From hugh@p@r@on@ge @end|ng |rom gm@||@com  Wed Jul 13 01:19:22 2022
From: hugh@p@r@on@ge @end|ng |rom gm@||@com (Hugh Parsonage)
Date: Wed, 13 Jul 2022 09:19:22 +1000
Subject: [Rd] Recommended change to CheckLazyDataCompression section in WRE
Message-ID: <CAJmOi+PQowhEudmDGtDZ9T24BGP2zs7yQm5jWOBzXo46RoA3CQ@mail.gmail.com>

Thank you for the helpful function in WRE. I recommend the following
changes to avoid inadvertent errors

CheckLazyDataCompression <- function(pkg)
{
    pkg_name <- sub("_.*", "", basename(pkg))   # in case pkg is in a
different directory
    lib <- tempfile(); dir.create(lib)
    zs <- c("gzip", "bzip2", "xz")
    res <- double(3); names(res) <- zs   # is a double vector
    for (z in zs) {
        opts <- c(paste0("--data-compress=", z),
                  "--no-libs", "--no-help", "--no-demo", "--no-exec",
"--no-test-load")
        install.packages(pkg, lib, INSTALL_opts = opts, repos = NULL,
quiet = TRUE, type = "source")  # otherwise an error on Windows
        res[z] <- file.size(file.path(lib, pkg_name, "data", "Rdata.rdb"))
    }
    ceiling(res/1024)
}

Relatedly, the footnote (currently 24) says:
> For all the CRAN packages tested, either gz or bzip2 provided a very substantial reduction in installed size.

I believe this should be "xz or bzip2"

Finally, I also note the sentence in the same section

"Lazy-loading is not supported for very large datasets (those which
when serialized exceed 2GB, the limit for the format on 32-bit
platforms)"

Is this still applicable?

Best,

Hugh.



[Rd] Recommended change to CheckLazyDataCompression section in WRE
Hugh Parsonage