Installing R Packages on Ubuntu Using Command Line
In this tutorial, we will walk through the process of installing R packages on Ubuntu using the command line. Installing R packages is an essential task for any R user, and doing it via the command line can often be faster and more efficient than using the RStudio interface. Let’s dive in!
Step 1: Install R on Ubuntu
If you haven’t already installed R on your Ubuntu system, you can do so by running the following command in your terminal:
sudo apt install r-base
Step 2: Install Required Dependencies
Before installing R packages, you may need to install some dependencies. Run the following command to install common dependencies:
Step 3: Install R Packages
Now that R and the required dependencies are installed, you can start installing R packages. You can use the install.packages()
function in R, but if you prefer the command line, you can use the following command: