ass ` "libraryIQR" ` . (The
structure of this class may change in future versions.) Use ` .packages(all =
TRUE) ` to obtain just the names of all available packages, and ` [
installed.packages ](/link/installed.packages?package=base&version=3.6.2) () `
for even more information.

` library(help = somename) ` computes basic information about the package
somename  , and returns this in an object of class ` "packageInfo" ` . (The
structure of this class may change in future versions.) When used with the
default value ( ` NULL ` ) for ` lib.loc ` , the attached packages are
searched before the libraries.

##  References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S Language_ .
Wadsworth & Brooks/Cole.

##  See Also

` [ .libPaths ](/link/.libPaths?package=base&version=3.6.2) ` , ` [ .packages
](/link/.packages?package=base&version=3.6.2) ` .

` [ attach ](/link/attach?package=base&version=3.6.2) ` , ` [ detach
](/link/detach?package=base&version=3.6.2) ` , ` [ search
](/link/search?package=base&version=3.6.2) ` , ` [ objects
](/link/objects?package=base&version=3.6.2) ` , ` [ autoload
](/link/autoload?package=base&version=3.6.2) ` , ` [ requireNamespace
](/link/requireNamespace?package=base&version=3.6.2) ` , ` [ library.dynam
](/link/library.dynam?package=base&version=3.6.2) ` , ` [ data
](/link/data?package=base&version=3.6.2) ` , ` [ install.packages
](/link/install.packages?package=base&version=3.6.2) ` and ` [
installed.packages ](/link/installed.packages?package=base&version=3.6.2) ` ;
` [ INSTALL ](/link/INSTALL?package=base&version=3.6.2) ` , ` [ REMOVE
](/link/REMOVE?package=base&version=3.6.2) ` .

The initial set of packages attached is set by ` [ options
](/link/options?package=base&version=3.6.2) (defaultPackages=) ` : see also `
[ Startup ](/link/Startup?package=base&version=3.6.2) ` .

##  Examples

[ Run this code
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Flibrary&utm_source=r-docs&utm_medium=docs&utm_term=library&utm_content=run_example_in_workspace)

    
    
    # NOT RUN {
    library()                   # list all available packages
    library(lib.loc = .Library) # list all packages in the default library
    # }
    # NOT RUN {
    library(help = splines)     # documentation on package 'splines'
    # }
    # NOT RUN {
    library(splines)            # attach package 'splines'
    require(splines)            # the same
    search()                    # "splines", too
    detach("package:splines")
    
    # if the package name is in a character vector, use
    pkg <- "splines"
    library(pkg, character.only = TRUE)
    detach(pos = match(paste("package", pkg, sep = ":"), search()))
    
    require(pkg, character.only = TRUE)
    detach(pos = match(paste("package", pkg, sep = ":"), search()))
    
    require(nonexistent)        # FALSE
    # }
    # NOT RUN {
    ## if you want to mask as little as possible, use
    library(mypkg, pos = "package:base")
    # }
    

Run the code above in your browser using  [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Flibrary&utm_source=r-docs&utm_medium=docs&utm_term=library&utm_content=run_example_in_workspace)

Powered by  [ DataCamp ](https://www.datacamp.com/)