ns-load                 package:base                 R Documentation

_L_o_a_d_i_n_g _a_n_d _U_n_l_o_a_d_i_n_g _N_a_m_e _S_p_a_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Functions to load and unload namespaces.

_U_s_a_g_e:

     attachNamespace(ns, pos = 2, dataPath = NULL)
     loadNamespace(package, lib.loc = NULL,
                   keep.source = getOption("keep.source.pkgs"),
                   partial = FALSE, declarativeOnly = FALSE)
     loadedNamespaces()
     unloadNamespace(ns)

_A_r_g_u_m_e_n_t_s:

      ns: string or namespace object.

     pos: integer specifying position to attach.

dataPath: path to directory containing a database of datasets to be
          lazy-loaded into the attached environment.

 package: string naming the package/name space to load.

 lib.loc: character vector specifying library search path.

keep.source: logical specifying whether to retain source. This applies
          only to the specified name space, and not to other name
          spaces which might be loaded to satisfy imports.

          For more details see this argument to 'library'. 

 partial: logical; if true, stop just after loading code.

declarativeOnly: logical; disables '.Import', etc, if true.

_D_e_t_a_i_l_s:

     The functions 'loadNamespace' and 'attachNamespace' are usually
     called implicitly when 'library' is used to load a name space and
     any imports needed.  However it may be useful to call these
     functions directly at times.

     'loadNamespace' loads the specified name space and registers it in
     an internal data base.  A request to load a name space when one of
     that name is already loaded has no effect.  The arguments have the
     same meaning as the corresponding arguments to 'library', whose
     help page explains the details of how a particular installed
     package comes to be chosen.  After loading, 'loadNamespace' looks
     for a hook function named '.onLoad' as an internal variable in the
     name space (it should not be exported).  This function is called
     with the same arguments as '.First.lib'.  Partial loading is used
     to support installation with the '--save' and '--lazy' options.

     'loadNamespace' does not attach the name space it loads to the
     search path.  'attachNamespace' can be used to attach a frame
     containing the exported values of a name space to the search path.
     The hook function '.onAttach' is run after the name space exports
     are attached.

     'loadedNamespaces' returns a character vector of the names of the
     loaded name spaces.

     'unloadNamespace' can be used to attempt to force a name space to
     be unloaded.  If the namespace is attached, it is first
     'detach'ed, thereby running a '.Last.lib' function in the
     namespace if one is exported.  Then an error is signaled if the
     name space is imported by other loaded name spaces, and the
     namespace is not unloaded.  If defined, a hook function
     '.onUnload' is run before removing the name space from the
     internal registry.

_V_a_l_u_e:

     'attachNamespace' returns invisibly the environment it adds to the
     search path.

     'loadNamespace' returns the namespace environment, either one
     already loaded or the one the function causes to be loaded.

     'loadedNamespaces' returns a character vector.

     'unloadNamespace' returns 'NULL', invisibly.

_A_u_t_h_o_r(_s):

     Luke Tierney

