Install R External Packages

Q

How to Install R External Packages?

✍: FYIcenter.com

A

R software environment comes with only the standard built-in package. If you want to use any external packages, you need to install it first as shown in this tutorial.

1. Start the R Console on your local computer.

2. Try to load the package using the "library()" statement. You see an error.

> library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’

3. Install the missing package using the "install.packages()" statement. You see a R package mirror site list.

4. Select a mirror site near your location. You see the requested package is downloaded. Any packages required by the requested package are also download.

5. Load the package again. You see no errors.

> library(ggplot2)

Note that you still see errors, you can run the "install.packages()" statement again.

R - Install External Package
R - Install External Package

 

Run R Code Online

Install R Software Environment on Windows

Installing R Software Environment

⇑⇑ R Software Environment - Frequently Asked Questions

2023-07-29, 263🔥, 0💬