![]() To set the repository and avoid having to specify this at every package install, simply: This means that whenever you start R, the directory /data/Rpackages/ is added to the list of places to look for R packages and so:Įvery time you install a R package, you are asked which repository R should use. Renviron in our home area, and add the line R_LIBS=/data/Rpackages/ to it. It’s a bit of a pain having to type /data/Rpackages/ all the time. > library(ggplot2, lib.loc="/data/Rpackages/") > install.packages("ggplot2", lib="/data/Rpackages/") On my machine, I use the directory /data/Rpackages/ After creating a package directory, to install a package we use the command: which server should you use to download the package.įirst, you need to designate a directory where you will store the downloaded packages. you will be asked to select your local mirror, i.e. ![]() if you are using Linux and don’t have root access, this command won’t work.In theory the package should just install, however: Let’s suppose you want to install the ggplot2 package. This is a short post giving steps on how to actually install R packages. In the last few years, the number of packages has grown exponentially! Part of the reason R has become so popular is the vast array of packages available at the cran and bioconductor repositories.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |