How To Install R on Debian 11
R is a programming language that is often utilized by statisticians because of its capabilities in statistical computing. In this tutorial we will describe how to install R on Debian 11.
Step 1: Update system
apt update apt -y upgrade
Step 2: Install R on Debian 11
apt -y install r-base
Step 3. Test the Installation
To exit R, type:
Then press ENTER. When prompted to save the workspace image, answer Y to save the workspace, N to exit without saving, or C to cancel and return to R.
Step 4. Install Packages
R packages extend the capabilities of R. Packages are only available to the user who installed them unless they are installed by the root user.
Install the package. Replace example with the desired package.
Here is a list of useful R packages.
A Demo with txtplot
The txtplot library can output many different kinds of charts in ASCII.
Install the txtplot package.
Load the txtplot package.
Plot the speed and distance required for a car to stop, using R’s default datasets package.
> txtplot(cars[,1], cars[,2], xlab = 'speed', ylab = 'distance')
The output looks like this:
Use the help command to learn more about a library. For example, to learn more about the txtplot library, run the following command.
In this post you learned how to install R on Debian 11 Linux distribution.