Installing and using packages
Problem
You want to do install and use a package.
Solution
If you are using a GUI for R, there is likely a menu-driven way of installing packages. This is how to do it from the command line:
install.packages('reshape2')
In each new R session where you use the package, you will have to load it:
library(reshape2)
If you use the package in a script, put this line in the script.
To update all your installed packages to the latest versions available:
update.packages()
If you are using R on Linux, some of the R packages may be installed at the system level by the root user, and can’t be updated this way, since you won’t haver permission to overwrite them.
当前内容版权归 cookbook-r.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 cookbook-r.com .