For details about the install. Packages () function, see install the r package (install. Packages function)
R packages generally have two types:
1 Binary Package: this package is a ready-to-use package, but its dependency is different from that on the platform, that is, win and Linux.
2 source package: This type of package can be used across platforms, but it needs to be processed or compiled before it is used (Compiled ).
The following are some common package-related functions:
. Libpaths (): view the package installation directory
Library (): View Installed Package Directories
Library (mypackage): load the mypackage package
Getoption ("defaultpackages"): displays the packages automatically loaded when R is started.
Help (package = 'mypackage'): view the help of 'mypackage '.
ARGs (function): View function parameters
Example (function): an example in the help document for automatically running this function. This is awesome!
Demo ("package"): demostration in some packages. Do you need to check it again ??
Vignette ('mypackage'): some packages, especially bioconductor's packages, include vignette, which can be viewed using functions.
Openvignette ('mypackage'): this function can also be used to view vignette.
Rsitesearch ("helpinfor"): searches for "helpinfor" Information on the R website.
Help. Start (): view the detailed HTML document of the installed package,
This command is awesome..
Update:
Search (): view the currently loaded package
Sessioninfo (): view the packages loaded in R
Methods (): view all methods in an S3 generic function or all methods in a class (S3: s version 3)
Showmethods (class = "myclass"): view the S4 class method findmethods ("mymethods"): view the method code class (myobject): view the class of an object
Getclass ("Class/package"): view the specific content of a class or package getslots ("class"): view the slotslotnames (myobject) of A Class: view the slot of an object. You can use myobject @ slotnames to access the slot value of the object. This @ design is really cool and can be used continuously. Query package information: 1 .? Function/method: view the details of a function or method.
2. Class? Graph: An Example of viewing the details of a group. The source of this example is to view the class information when querying the graph package. Input ?? After graph, a graph: Graph-class appears.
Ls ("package: mypackage"): view all objects in "mypackage.
Install source package
1. Enter # R cmd install/.../mypackage.tar.gz on the terminal.
To use this method, you need to solve the package dependency problem, that is, to install the package that this package depends on, the installation process is prompted
2 You can also use the install. Packages () function of R to install
A: You can use the install. Packages () function for installation. It is easy to install, that is, it can be installed online.
# R
> Install. Packages ('mypackage ')
Answer 2: You can use install. packages () is used to install locally downloaded packages, especially for installation packages $ r> install on servers. packages (C ("XML_0.99-5.tar.gz", "http://www.cnblogs.com/Interfaces/Perl/RSPerl_0.8-0.tar.gz"), repos = NULL, configure. ARGs = C (xml = '-- With-XML-Config = XML-config', rsperl = "-- with-modules = 'IO fcntl '"))
3 bioconductor Installation Method
> Source ("http://bioconductor.org/biocLite.R ")
> Bioclite ("mypackage ")
4. Uninstall packageremove. packages ("mypackage") 5. View versionr version: version or R. versionr package version: 6. Update the update package. packages () can regularly perform the following 7 Package modifications installed by others. bashrc file, add the Lib path of environment variable R export r_libs =/home /... /R/lib64/R/libraryr. libpaths () function to view the Lib path. If there are multiple Lib, install. packages () is installed in the first directory by default.
Link: http://blog.sina.com.cn/s/blog_61f013b80100ljgq.html