R(8), Package

Published: by Creative Commons Licence

All the packages in R, Click Here!

get the location of the library containing the R package.

.libPaths()

get the list of all installed packages

library()

get the list of all loaded packages in the current R environment

search()

How to Install a New Package

Method ONE:

install.packages("Package Name")
 
# Install the package named "XML".
install.packages("XML")

Method TWO:

  1. click here to find the needed packages and download them.
  2. save the packages we download as a .zip file in a suitable location in the local system.
install.packages(file_name_with_path, repos = NULL, type = "source")

# Install the package named "XML"
install.packages("E:/XML_3.98-1.3.zip", repos = NULL, type = "source")

Method THREE:

Using the visual interface: RStudio -> 'packages' -> 'install' -> input the name of the wanted packages -> download it

How to Load Packages

Before the packages can be used, we need to load them before the programme is running. (Also, packages downloaded before that cannot be used in the environment should be loaded at first as well.)

the command follows:

library("package Name", lib.loc = "path to library")

# Load the package named "XML"
install.packages("E:/XML_3.98-1.3.zip", repos = NULL, type = "source")

Update Packages

update.packages("package name")

Details of Packages

help("package name")