

Others are available for download and installation. The directory where packages are stored is called the library.

So where do packages fit into these tasks? From Quick-R: “Packages are collections of R functions, data, and compiled code in a well-defined format. Except in rare instances, these warnings can be ignored since "older" packages are usually still compatible with newer versions of R.R code is used to run programs that perform helpful tasks on the computer, from performing statistical tests on data to saving files downloaded from the internet.

Note: quotation marks should NOT be used when calling the library() function.īe aware that sometimes warning messages will be given in the command window when installing certain packages indicating that the package was built using an older version of R. Load, or install, the package – type and run library(package name) from within your script window or as a line in the Console window.Note: both the period in the function call and the quotation marks around the package name are necessary. Option b) from within the console window or from within a script, run install.packages('package name').Option a) from within RStudio, click the Packages tab, then click Install, begin to type the name of the package in the middle box, and click install (note that leaving Install Dependences checked will download any additional packages needed to use all capabilities of the package you are currently downloading).Download the package – This can be accomplished in one of two ways:.Know the name of the package – sometimes, you will need to google what you are trying to do in order to get the name of the package.There are three steps to implementing packages in R. Checking what packages are already loaded (3:48).It is highly suggested that you only download packages from CRAN since these packages are routinely updated and screened for problems.

Within RStudio you have easy access to CRAN via connections through "mirrors" which are locations around the world that grant you access to download these packages. Though some people only share their packages on their personal websites, most will upload their packages to a common location on the web call the CRAN Archive Network. However, for specific types of actions we often need to download and install additional packages that others have created and kindly shared online. R comes with a "base" package, which gives you the ability to perform many common actions like finding the mean or plotting the histogram of a column of data. These packages are collections of scripts that work together to carry out desired routines (or a series of steps). FREE, which is awesome!), there is a large and constantly growing community of people sharing their "R packages" (which is even more awesome!).
