1
1
% File src / library / base / man / ns - load.Rd
2
2
% Part of the R package , https : // www.R - project.org
3
- % Copyright 1995 - 2022 R Core Team
3
+ % Copyright 1995 - 2025 R Core Team
4
4
% Distributed under GPL 2 or later
5
5
6
6
\name {ns - load }
15
15
\alias {isNamespaceLoaded }
16
16
17
17
\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.
19
21
}
20
22
\usage {
21
23
attachNamespace(ns , pos = 2L , depends = NULL , exclude , include.only )
@@ -39,8 +41,10 @@ isNamespaceLoaded(name)
39
41
\item {keep.source }{now ignored except during package installation. }
40
42
\item {keep.parse.data }{ignored except during package installation. }
41
43
\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. }
44
48
\item {quietly }{logical : should progress and error messages be suppressed ?}
45
49
\item {name }{string or \sQuote {name }, see \code {\link {as.symbol }},
46
50
of a package , e.g. , \code {" stats" }. }
@@ -55,7 +59,13 @@ isNamespaceLoaded(name)
55
59
56
60
\code {loadNamespace } loads the specified name space and registers it in
57
61
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
59
69
meaning as the corresponding arguments to \c ode{\l ink{library}}, whose
60
70
help page explains the details of how a particular installed package
61
71
comes to be chosen. After loading, \c ode{loadNamespace} looks for a
0 commit comments