(1) Install the R package either from the UNIX console or R console to a directory within your user account.
From UNIX console:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
R CMD INSTALL pkg -l /R_packages/ |
From R console:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("pkg", lib="/R_packages/") |
In the above example, pkg is the R package you want to install and /R_packages/ is the directory you would like to install them in.
(2) To load the package for use in R, simply put the following command in your script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("pkg", lib.loc="R_packages/") |
No comments:
Post a Comment