Skip to content

Commit 26a286c

Browse files
author
maechler
committed
improve, notably on versionCheck
git-svn-id: https://svn.r-project.org/R/trunk@88393 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent a1b28ce commit 26a286c

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/library/base/man/ns-load.Rd

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% File src/library/base/man/ns-load.Rd
22
% Part of the R package, https://www.R-project.org
3-
% Copyright 1995-2022 R Core Team
3+
% Copyright 1995-2025 R Core Team
44
% Distributed under GPL 2 or later
55

66
\name{ns-load}
@@ -15,7 +15,9 @@
1515
\alias{isNamespaceLoaded}
1616

1717
\description{
18-
Functions to load and unload name spaces.
18+
Functions to load and unload name spaces explicitly. Loading namespaces typically
19+
happens automatically, often from \code{\link{library}()} or also when
20+
other packages import their dependent package namespaces.
1921
}
2022
\usage{
2123
attachNamespace(ns, pos = 2L, depends = NULL, exclude, include.only)
@@ -39,8 +41,10 @@ isNamespaceLoaded(name)
3941
\item{keep.source}{now ignored except during package installation.}
4042
\item{keep.parse.data}{ignored except during package installation.}
4143
\item{partial}{logical; if true, stop just after loading code.}
42-
\item{versionCheck}{\code{NULL} or a version specification (a list
43-
with components \code{op} and \code{version}).}
44+
\item{versionCheck}{\code{NULL} or a version specification, i.e., a
45+
\code{\link{list}} with components \code{op} and \code{version} where
46+
\code{op} is a string denoting a \code{\link{Comparison}} operator such
47+
as \code{">="}, \code{"=="}, \code{"<"}, etc.}
4448
\item{quietly}{logical: should progress and error messages be suppressed?}
4549
\item{name}{string or \sQuote{name}, see \code{\link{as.symbol}},
4650
of a package, e.g., \code{"stats"}.}
@@ -55,7 +59,13 @@ isNamespaceLoaded(name)
5559

5660
\code{loadNamespace} loads the specified name space and registers it in
5761
an internal data base. A request to load a name space when one of that
58-
name is already loaded has no effect. The arguments have the same
62+
name is already loaded has no effect. \code{versionCheck} allows to
63+
require a namespace with restricted (e.g., minimal or maximal) package
64+
version (\code{\link{packageVersion}()}). If the version check fails,
65+
\code{loadNamespace()} signals an error, whereas \code{requireNamespace()}
66+
returns \code{FALSE} after showing \code{loadNamespace}'s error message.
67+
68+
Further arguments have the same
5969
meaning as the corresponding arguments to \code{\link{library}}, whose
6070
help page explains the details of how a particular installed package
6171
comes to be chosen. After loading, \code{loadNamespace} looks for a

0 commit comments

Comments
 (0)