From f4f2a2f3784b62b3cda471cddd8592928d1157a9 Mon Sep 17 00:00:00 2001 From: maechler Date: Wed, 6 Nov 2024 12:13:26 +0000 Subject: [PATCH] cosmetic changes, comments git-svn-id: https://svn.r-project.org/R/trunk@87291 00db46b3-68df-0310-9c12-caf00c1e9a41 --- etc/Makeconf.in | 2 +- src/library/base/R/connections.R | 2 +- src/library/base/man/as.POSIXlt.Rd | 4 ++-- src/library/base/man/format.Rd | 5 +++-- src/library/base/man/list.Rd | 4 ++-- src/library/base/man/qr.Rd | 4 ++-- src/library/base/man/source.Rd | 2 +- src/library/base/man/srcfile.Rd | 6 +++--- src/library/base/man/strsplit.Rd | 7 ++++--- src/library/base/man/substr.Rd | 1 + src/library/base/man/write.Rd | 3 ++- src/library/graphics/man/lines.Rd | 6 +++--- src/library/stats/man/TDist.Rd | 6 +++--- src/library/stats/man/integrate.Rd | 2 +- src/library/stats/man/mauchly.test.Rd | 6 +++--- src/library/tools/R/check.R | 2 +- 16 files changed, 33 insertions(+), 29 deletions(-) diff --git a/etc/Makeconf.in b/etc/Makeconf.in index d84a91272f..2f631bddda 100644 --- a/etc/Makeconf.in +++ b/etc/Makeconf.in @@ -1,4 +1,4 @@ -# @configure_input@ +# @configure_input@ -*- Makefile -*- # # ${R_HOME}/etc/Makeconf # diff --git a/src/library/base/R/connections.R b/src/library/base/R/connections.R index 4d8207b27a..f3b0c8214e 100644 --- a/src/library/base/R/connections.R +++ b/src/library/base/R/connections.R @@ -155,7 +155,7 @@ textConnection <- function(object, open = "r", local = FALSE, env <- if (local) parent.frame() else .GlobalEnv type <- match(match.arg(encoding), c("", "bytes", "UTF-8")) if(!(is.character(name) && length(name) == 1)) - stop("'name' must be a single character string") + stop(gettextf("'%s' must be a character string", "name"), domain = NA) .Internal(textConnection(name, object, open, env, type)) } diff --git a/src/library/base/man/as.POSIXlt.Rd b/src/library/base/man/as.POSIXlt.Rd index 5356708a4c..5e23ddff13 100644 --- a/src/library/base/man/as.POSIXlt.Rd +++ b/src/library/base/man/as.POSIXlt.Rd @@ -1,6 +1,6 @@ % File src/library/base/man/as.POSIXlt.Rd % Part of the R package, https://www.R-project.org -% Copyright 1995-2022 R Core Team +% Copyright 1995-2024 R Core Team % Distributed under GPL 2 or later \name{as.POSIX*} @@ -208,7 +208,7 @@ as.POSIXlt(Sys.time(), "Australia/Darwin") } tab <- file.path(R.home("share"), "zoneinfo", "zone1970.tab") -if(file.exists(tab)) { # typically on Windows; *not* on Linux +if(file.exists(tab)) { # typically on Windows; on Linux when `configure --with-internal-tzcode` cols <- c("code", "coordinates", "TZ", "comments") tmp <- read.delim(tab, header = FALSE, comment.char = "#", col.names = cols) diff --git a/src/library/base/man/format.Rd b/src/library/base/man/format.Rd index 2f3da2a804..95584df98b 100644 --- a/src/library/base/man/format.Rd +++ b/src/library/base/man/format.Rd @@ -5,15 +5,16 @@ % Distributed under GPL 2 or later \name{format} +\title{Encode in a Common Format} \alias{format} \alias{format.AsIs} \alias{format.data.frame} \alias{format.default} \alias{format.factor} \description{ - Format an \R object for pretty printing. + Format an \R object for pretty printing, notably encoding vector or + column elements into a common format. } -\title{Encode in a Common Format} \usage{ format(x, \dots) diff --git a/src/library/base/man/list.Rd b/src/library/base/man/list.Rd index 9fe2254ba5..d7e13ef9f4 100644 --- a/src/library/base/man/list.Rd +++ b/src/library/base/man/list.Rd @@ -1,6 +1,6 @@ % File src/library/base/man/list.Rd % Part of the R package, https://www.R-project.org -% Copyright 1995-2022 R Core Team +% Copyright 1995-2024 R Core Team % Distributed under GPL 2 or later \name{list} @@ -73,7 +73,7 @@ alist(\dots) \code{is.list} returns \code{TRUE} if and only if its argument is a \code{list} \emph{or} a \code{pairlist} of \code{length} \eqn{> 0}. \code{is.pairlist} returns \code{TRUE} if and only if the argument - is a pairlist or \code{NULL} (see below). + is a pairlist (or \code{NULL} which \emph{is} a pairlist, see below). The \code{"\link{environment}"} method for \code{as.list} copies the name-value pairs (for names not beginning with a dot) from an diff --git a/src/library/base/man/qr.Rd b/src/library/base/man/qr.Rd index a97e81b504..ec7af53b96 100644 --- a/src/library/base/man/qr.Rd +++ b/src/library/base/man/qr.Rd @@ -99,12 +99,12 @@ as.qr(x) \value{ The QR decomposition of the matrix as computed by LINPACK(*) or LAPACK. The components in the returned value correspond directly - to the values returned by \I{DQRDC}(2)/\I{DGEQP3}/\I{ZGEQP3}. + to the values returned by \I{DQRDC(2)}/\I{DGEQP3}/\I{ZGEQP3}. \item{qr}{a matrix with the same dimensions as \code{x}. The upper triangle contains the \eqn{\bold{R}} of the decomposition and the lower triangle contains information on the \eqn{\bold{Q}} of the decomposition (stored in compact form). Note that the storage - used by \I{DQRDC} and \I{DGEQP3} differs.} + used by \I{DQRDC} (LINPACK) and \I{DGEQP3} (LAPACK) differs.} \item{qraux}{a vector of length \code{ncol(x)} which contains additional information on \eqn{\bold{Q}}.} \item{rank}{the rank of \code{x} as computed by the decomposition(*): diff --git a/src/library/base/man/source.Rd b/src/library/base/man/source.Rd index 2b2e71ec8c..2d86072315 100644 --- a/src/library/base/man/source.Rd +++ b/src/library/base/man/source.Rd @@ -16,7 +16,7 @@ \code{withAutoprint(exprs)} is a wrapper for \code{source(exprs = exprs, ..)} with different defaults. Its main purpose is to evaluate - and auto-print expressions as if in a toplevel context, e.g, as in the + and auto-print expressions as if in a top-level context, e.g, as in the \R console. } \usage{ diff --git a/src/library/base/man/srcfile.Rd b/src/library/base/man/srcfile.Rd index f37ef6db27..964f7686d1 100644 --- a/src/library/base/man/srcfile.Rd +++ b/src/library/base/man/srcfile.Rd @@ -1,6 +1,6 @@ % File src/library/base/man/srcfile.Rd % Part of the R package, https://www.R-project.org -% Copyright 1995-2016 R Core Team +% Copyright 1995-2024 R Core Team % Distributed under GPL 2 or later \name{srcfile} @@ -155,8 +155,8 @@ srcref(srcfile, lloc) } \seealso{ \code{\link{getSrcFilename}} for extracting information from a source - reference, or \code{\link{removeSource}} to remove it from a - (non-primitive) function (aka \sQuote{closure}). + reference, or \code{\link{removeSource}} to remove it from a language + object or a (non-primitive) function (aka \sQuote{closure}). } \author{Duncan Murdoch} \examples{ diff --git a/src/library/base/man/strsplit.Rd b/src/library/base/man/strsplit.Rd index 4c5bee045c..4ce169d5ea 100644 --- a/src/library/base/man/strsplit.Rd +++ b/src/library/base/man/strsplit.Rd @@ -1,6 +1,6 @@ % File src/library/base/man/strsplit.Rd % Part of the R package, https://www.R-project.org -% Copyright 1995-2023 R Core Team +% Copyright 1995-2024 R Core Team % Distributed under GPL 2 or later \name{strsplit} @@ -107,11 +107,12 @@ strsplit(x, split, fixed = FALSE, perl = FALSE, useBytes = FALSE) \seealso{ \code{\link{paste}} for the reverse, \code{\link{grep}} and \code{\link{sub}} for string search and - manipulation; also \code{\link{nchar}}, \code{\link{substr}}. + manipulation; also \code{\link{nchar}}, \code{\link{substr}}, + \code{\link{startsWith}()}, and \code{endsWith()}. \sQuote{\link{regular expression}} for the details of the pattern specification. - + Option \code{PCRE_use_JIT} controls the details when \code{perl = TRUE}. } \examples{ diff --git a/src/library/base/man/substr.Rd b/src/library/base/man/substr.Rd index bac9715cf1..9dda4b3e06 100644 --- a/src/library/base/man/substr.Rd +++ b/src/library/base/man/substr.Rd @@ -89,6 +89,7 @@ substring(text, first, last = 1000000L) <- value Wadsworth & Brooks/Cole. (\code{substring}.) } \seealso{ + \code{\link{startsWith}} and \code{endsWith()}; \code{\link{strsplit}}, \code{\link{paste}}, \code{\link{nchar}}. } \examples{ diff --git a/src/library/base/man/write.Rd b/src/library/base/man/write.Rd index fdd764541e..1ec154d0c7 100644 --- a/src/library/base/man/write.Rd +++ b/src/library/base/man/write.Rd @@ -30,7 +30,8 @@ write(x, file = "data", \item{x}{the data to be written out. } \item{file}{a \code{\link{connection}}, or a character string naming the file to write to. If \code{""}, print to the standard output - connection. + connection, i.e., \code{""} is equivalent to \code{\link{stdout}()} + here. When \code{\link{.Platform}$OS.type != "windows"}, and it is \code{"|cmd"}, the output is piped to the command given diff --git a/src/library/graphics/man/lines.Rd b/src/library/graphics/man/lines.Rd index 617e8484b8..b9681d3591 100644 --- a/src/library/graphics/man/lines.Rd +++ b/src/library/graphics/man/lines.Rd @@ -1,6 +1,6 @@ % File src/library/graphics/man/lines.Rd % Part of the R package, https://www.R-project.org -% Copyright 1995-2013 R Core Team +% Copyright 1995-2024 R Core Team % Distributed under GPL 2 or later \name{lines} @@ -23,8 +23,8 @@ lines(x, \dots) \item{\dots}{Further graphical parameters (see \code{\link{par}}) may also be supplied as arguments, particularly, line type, \code{lty}, line width, \code{lwd}, color, \code{col} and for \code{type = "b"}, - \code{pch}. Also the line characteristics \code{lend}, \code{ljoin} - and \code{lmitre}.} + \code{pch} (see \code{\link{points}} for details). Also the line + characteristics \code{lend}, \code{ljoin} and \code{lmitre}.} } \details{ The coordinates can be passed in a plotting structure diff --git a/src/library/stats/man/TDist.Rd b/src/library/stats/man/TDist.Rd index 52542237b8..5b31e932a2 100644 --- a/src/library/stats/man/TDist.Rd +++ b/src/library/stats/man/TDist.Rd @@ -115,7 +115,7 @@ rt(n, df, ncp) Lenth, R. V. (1989). \emph{Algorithm AS 243} --- Cumulative distribution function of the non-central \eqn{t} distribution, - \emph{Applied Statistics} \bold{38}, 185--189. + \emph{Applied Statistics} \bold{38}, 185--189; \doi{10.2307/2347693} . This computes the lower tail only, so the upper tail currently suffers from cancellation and a warning will be given when this is likely to be @@ -124,12 +124,12 @@ rt(n, df, ncp) For central \code{qt}, a C translation of Hill, G. W. (1970) Algorithm 396: Student's t-quantiles. - \emph{Communications of the ACM}, \bold{13(10)}, 619--620. % \doi{10.1145/355598.355599} + \emph{Communications of the ACM}, \bold{13(10)}, 619--620; \doi{10.1145/355598.355599} . altered to take account of Hill, G. W. (1981) Remark on Algorithm 396, \emph{ACM Transactions on - Mathematical Software}, \bold{7}, 250--1. % \doi{10.1145/355945.355956} + Mathematical Software}, \bold{7}, 250--1; \doi{10.1145/355945.355956} . The non-central case is done by inversion. } diff --git a/src/library/stats/man/integrate.Rd b/src/library/stats/man/integrate.Rd index 8895246190..a3ab5cef34 100644 --- a/src/library/stats/man/integrate.Rd +++ b/src/library/stats/man/integrate.Rd @@ -116,7 +116,7 @@ integrate(dnorm, 0, 2) integrate(dnorm, 0, 20) integrate(dnorm, 0, 200) integrate(dnorm, 0, 2000) -integrate(dnorm, 0, 20000) ## fails on many systems +integrate(dnorm, 0, 20000) ## "fails" on many systems -- "wrongly" giving '0' integrate(dnorm, 0, Inf) ## works \dontshow{tools::assertError(} integrate(dnorm, 0:1, 20) #-> error! diff --git a/src/library/stats/man/mauchly.test.Rd b/src/library/stats/man/mauchly.test.Rd index fca0e6cd49..d526a9849f 100644 --- a/src/library/stats/man/mauchly.test.Rd +++ b/src/library/stats/man/mauchly.test.Rd @@ -1,6 +1,6 @@ % File src/library/stats/man/mauchly.test.Rd % Part of the R package, https://www.R-project.org -% Copyright 1995-2007 R Core Team +% Copyright 1995-2023 R Core Team % Distributed under GPL 2 or later \name{mauchly.test} @@ -16,8 +16,8 @@ mauchly.test(object, ...) \method{mauchly.test}{mlm}(object, ...) \method{mauchly.test}{SSD}(object, Sigma = diag(nrow = p), - T = Thin.row(Proj(M) - Proj(X)), M = diag(nrow = p), X = ~0, - idata = data.frame(index = seq_len(p)), ...) + T = Thin.row(Proj(M) - Proj(X)), M = diag(nrow = p), X = ~0, + idata = data.frame(index = seq_len(p)), ...) } \arguments{ \item{object}{object of class \code{SSD} or \code{mlm}.} diff --git a/src/library/tools/R/check.R b/src/library/tools/R/check.R index 81492925e9..2fe5607607 100644 --- a/src/library/tools/R/check.R +++ b/src/library/tools/R/check.R @@ -528,7 +528,7 @@ add_dummies <- function(dir, Log) as.POSIXct(gsub(".*\"datetime\":\"([^Z]*).*", "\\1", foo), "UTC", "%Y-%m-%dT%H:%M:%S") }, error = function(e) NA) - if(identical(NA, now)) { + if(identical(NA, now)) { # try http (no 's') now <- tryCatch({ foo <- suppressWarnings(readLines("http://worldtimeapi.org/api/timezone/etc/UTC", warn = FALSE))