diff --git a/src/library/base/man/memCompress.Rd b/src/library/base/man/memCompress.Rd index d9ad1ed99b..96e9780a4e 100644 --- a/src/library/base/man/memCompress.Rd +++ b/src/library/base/man/memCompress.Rd @@ -1,6 +1,6 @@ % File src/library/base/man/memCompress.Rd % Part of the R package, https://www.R-project.org -% Copyright 2009-2023 R Core Team +% Copyright 2009-2025 R Core Team % Distributed under GPL 2 or later \name{memCompress} @@ -56,9 +56,9 @@ memDecompress(from, \eqn{2^{31}-1}{2^31 - 1} elements. Compression is equivalent to \command{bzip2 -9} (the default). - \command{zstd} compression is optional and currently uses compression - level 3 which gives a good compression ratio vs compression speed - trade-off. + \command{zstd} compression was introduced in \R 4.5.0: it is an + optional part of the \R build and currently uses compression level 3 + which gives a good compression ratio vs compression speed trade-off. Compressing with \code{type = "xz"} is equivalent to compressing a file with \command{xz -9e} (including adding the \sQuote{magic} diff --git a/src/library/base/man/readRDS.Rd b/src/library/base/man/readRDS.Rd index 320a8d30a9..04658917a4 100644 --- a/src/library/base/man/readRDS.Rd +++ b/src/library/base/man/readRDS.Rd @@ -1,6 +1,6 @@ % File src/library/base/man/serialize.Rd % Part of the R package, https://www.R-project.org -% Copyright 1995-2021 R Core Team +% Copyright 1995-2025 R Core Team % Distributed under GPL 2 or later \name{readRDS} @@ -20,18 +20,18 @@ infoRDS(file) } \arguments{ \item{object}{\R object to serialize.} - \item{file}{a \link{connection} or the name of the file where the \R object - is saved to or read from.} + \item{file}{a \link{connection} or the path name of the file where the + \R object is saved to or read from.} \item{ascii}{a logical. If \code{TRUE} or \code{NA}, an ASCII representation is written; otherwise (default), a binary one is used. See the comments in the help for \code{\link{save}}.} \item{version}{the workspace format version to use. \code{NULL} - specifies the current default version (3). The only other supported + specifies the current default version (3). The only other supported value is 2, the default from \R 1.4.0 to \R 3.5.0.} \item{compress}{a logical specifying whether saving to a named file is to use \code{"gzip"} compression, or one of \code{"gzip"}, - \code{"bzip2"} or \code{"xz"} to indicate the type of compression to - be used. Ignored if \code{file} is a connection.} + \code{"bzip2"}, \code{"xz"} or \code{"zstd"} to indicate the type of + compression to be used. Ignored if \code{file} is a connection.} \item{refhook}{a hook function for handling reference objects.} } \details{ @@ -97,6 +97,9 @@ infoRDS(file) machines, for example to download from a website. The files produced by \code{\link{save}} have a header identifying the file type and so are better protected against erroneous use. + + \code{compress = "zstd"} was first supported in \R 4.5.0, and needs OS + support so is even less suited as an interchange format. } \seealso{ diff --git a/src/library/base/man/save.Rd b/src/library/base/man/save.Rd index ad444c920a..d6f0d0ee62 100644 --- a/src/library/base/man/save.Rd +++ b/src/library/base/man/save.Rd @@ -1,6 +1,6 @@ % File src/library/base/man/save.Rd % Part of the R package, https://www.R-project.org -% Copyright 1995-2020 R Core Team +% Copyright 1995-2025 R Core Team % Distributed under GPL 2 or later \name{save} @@ -50,7 +50,7 @@ save.image(file = ".RData", version = NULL, ascii = FALSE, \item{compress}{logical or character string specifying whether saving to a named file is to use compression. \code{TRUE} corresponds to \command{gzip} compression, and character strings \code{"gzip"}, - \code{"bzip2"} or \code{"xz"} specify the type of + \code{"bzip2"}, \code{"xz"} or \code{"zstd"} specify the type of compression. Ignored when \code{file} is a connection and for workspace format version 1.} \item{compression_level}{integer: the level of compression to be @@ -180,12 +180,16 @@ save.image(file = ".RData", version = NULL, ascii = FALSE, vectors, external pointers and some S4 objects). One such \sQuote{later addition} was \link{long vectors}, introduced in \R - 3.0.0 and loadable only on 64-bit platforms. + 3.0.0 and loadable only on 64-bit platforms (32-bit platforms are + dperecated but still supported). Loading files saved with \code{ASCII = NA} requires a C99-compliant C - function \code{sscanf}: this is a problem on Windows, first worked + function \code{sscanf}: this was a problem on Windows, first worked around in \R 3.1.2: version-2 files in that format should be readable in earlier versions of \R on all other platforms. + + \code{compress = "zstd"} was first supported in \R 4.5.0 and needs + (optional) OS support so is not recommended as an interchange format. } \seealso{ \code{\link{dput}}, \code{\link{dump}}, \code{\link{load}}, diff --git a/src/library/tools/man/writePACKAGES.Rd b/src/library/tools/man/writePACKAGES.Rd index 418facac92..292b21e733 100644 --- a/src/library/tools/man/writePACKAGES.Rd +++ b/src/library/tools/man/writePACKAGES.Rd @@ -40,7 +40,7 @@ write_PACKAGES(dir = ".", fields = NULL, are used. } \item{type}{ - Type of packages: currently source \file{.tar.\{gz,bz2,xz\}} archives, + Type of packages: currently source \file{.tar.\{gz,bz2,xz,zstd\}} archives, and macOS or Windows binary (\file{.tgz} or \file{.zip}, respectively) packages are supported. Defaults to \code{"win.binary"} on Windows and to \code{"source"} otherwise. diff --git a/src/library/utils/R/packages2.R b/src/library/utils/R/packages2.R index f0c18caced..32c2b0926c 100644 --- a/src/library/utils/R/packages2.R +++ b/src/library/utils/R/packages2.R @@ -194,7 +194,7 @@ install.packages <- get_package_name <- function(pkg) { ## Since the pkg argument can be the name of a file rather than ## a regular package name, we have to clean that up. - gsub("_[.](zip|tar[.]gz|tar[.]bzip2|tar[.]xz)", "", + gsub("_[.](zip|tar[.](gz|bzip2|bz2|xz|zstd|xst))", "", gsub(.standard_regexps()$valid_package_version, "", basename(pkg))) } @@ -399,7 +399,7 @@ install.packages <- df <- function(p, destfile, method, ...) download.file(p, destfile, method, mode = "wb", ...) urls <- unique(pkgs[web]) - + if (missing(method) || method == "auto" || method == "libcurl") { # bulk download using libcurl destfiles <- file.path(tmpd, basename(urls)) @@ -417,7 +417,7 @@ install.packages <- } else pkgs[web] <- destfiles } else - pkgs[web] <- NA + pkgs[web] <- NA } else { # serial download for (p in urls) {