RStudio is a development environment platform created for developers who are interested in the statistical programming language R. The platform is available in both open-source and commercial editions, of course, the feature difference will be there. The paid version will have more extensive features than the open-source one.
Here we are installing the non-commercial version of Rstudio on Ubuntu 20.04 which can be upgraded to a commercial one. The software offers an editor with syntax highlighting, console, and direct code execution. Whereas those running the CLI server can use the Rstudio Server or RStudio Server Pro to access it via a web browser.
Few Rstudio features:
- Built-in IDE
- Workspace browser and data viewer
- Interactive debugger
- Use Source editor to directly execute the code
- Cross-platform, support Windows, macOS, and Linux.
- Integrated support for Git and Subversion
- Syntax highlighting
- Auto code completion
- Smart indentation
Easy Steps to install Rstudio on Ubuntu 20.04 LTS
Add gpg key and R-base repository
To add the repository for installing R-base on Ubuntu first we need to add the key so that system can verify the packages we are about to download, is from a genuine source.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/"
Update the system
Next, run the system update command to ensure all packages are up to date and to rebuild the repo cache.
sudo apt update
Install R-base package
Without the R-base package, the RStudio will not work on Ubuntu 20.04 or earlier version of Linux, it is a package that contains basic R-functions needed by the platform to perform various arithmetic operations while programming.
sudo apt install r-base
Download Rstudio Debian Package
Go to the official website for the Rstudio and then click on the Ubuntu/Debian Linux .deb package available to download.
Install Rstudio on Ubuntu Linux
It doesn’t matter if you are on Ubuntu 20.04 or 19.04/18.04 the steps of installing it will be the same. Therefore, switch to the Downloads directory as whatever we download from the browser goes to this folder.
See the files:
Use the APT Package manager command:
sudo apt install ./rstudio-*-amd64.deb
Go to Applications and you will find the Rstudio icon, click on it to run.
After setting up the R-base, you can install Rstudio on any Linux system such as CentOS, Ubuntu, and other supported ones using the quick installation command that is
bash -c "$(curl -L https://rstd.io/r-install)"
However, make sure the curl is there on your system. Moreover, you can visit the GitHub page of this project to know more about it and other installation methods of Rstudio supported by various other Linux OS.
5 thoughts on “How to install Rstudio & R-base Ubuntu 20.04 LTS Linux”
Nice work on this article!
if R hasn’t installed in your system, just install it first and add “rsession-which-r=/which/your/R/installed/bin/R” in the /etc/rstudio/rserver.conf file. If you already installed R, just add the command line in the file and restart the Rtudio-server
I have followed through these steps, however when I try to launch RStudio this message appears “Path to R not specified, and no module binary specified; Invalid R module ()”.
I’m not really sure what to do; any ideas? Thanks!
Otherwise greatly written article, very clear to follow!
It worked for me, after a reboot of OS.