How To Download and Install R

Kuizu

How To Download and Install R

6 min read

What is R?

R is an open source programming language that specializes in data science, data engineering, data analysis, statistical modeling, machine learning, and artificial intelligence (AI).

R is an easy-to-learn programming language. Professionals who use it typically work as data scientists, data analysts, data engineers, AI engineers, and they also in quantitative finance, economics, business, and marketing.

Although R’s specialty is data, it’s a functional and general programming language as well so you can also use it for automation of tasks, building web applications, and using APIs.

Anyone looking to do anything with data would find R a highly valuable skill to learn. Employers are consistently seeking data professionals who know R as they are in high demand.



Is it even useful to download and learn R?

It is useful to learn R as a programming language for data science, analytics, and AI. Most employers of data scientists and data analysts require R as a pre-requisite for employment.

R is one of the most popular programming languages in the data industry, and it continues to gain in popularity every year:

  • R consistently ranks in the top 20 most popular programming languages on the TIOBE Index, which is a commonly referenced index by technology professionals.
  • R consistently ranks in the top 10 most popular programming languages on the PYPL Popularity of Programming Language Index.
  • R has been consistently trending upwards in popularity since 2009, according to StackOverflow Trends. StackOverflow has significantly high usage among professional programmers.


StackOverflow Trends for R Programming



How do I download R?

You download R from a central repository called CRAN, which stands for Comprehensive R Archive Network. CRAN is a network of FTP and web servers around the world that store identical, up-to-date versions of code and documentation for R.

You can download R for Windows, Mac, or Linux. Start the download process by clicking on the link for the operating system you’re using.



What is RStudio?

RStudio is a free and open source integrated development environment (IDE) for R. It is the arguably the most popular IDE among R users, with lots of support and features.

An IDE is software for building applications that combines development tools into a single graphical user interface (GUI). This helps increase a programmer’s productivity by combining common activities of writing code into a single GUI: editing source code, running the source code, viewing data tables, viewing data frames, viewing charts/graphs, and connecting to external data sources.

Essentially, RStudio acts as a one-stop-shop for all things related to coding in R. RStudio is created and maintained by a commercial software company called RStudio, PBC, which is well-known in the R community.



How do I download RStudio?

Download the RStudio IDE Desktop by choosing the “Free” version by clicking the button below or using this link. You can download RStudio IDE for Windows, Mac, or Linux so choose the correct installer for the operating system you’re using.

Note: you must download R first before you download RStudio. During the installation process, RStudio checks if R is already installed on your machine, and if it’s not, it asks you download it first.


Once you’ve download RStudio, open it on your computer. If the installation was successful, it’ll look something like this:



Basic Anatomy of the RStudio IDE

After you’ve downloaded, installed, and opened up RStudio for the first time, you might be curious on how to navigate RStudio’s GUI. Below is a basic anatomy rundown of RStudio. The panes of the IDE are separated into 4 main panes by default, however, you can re-arrange and customize the panes to your liking by going to View > Panes > Pane Layout.

  1. Code Editor
    • This is where you write, edit, and run code. You can have multiple tabs open and edit and run several different types of code files such as R, Python, SQL, JavaScript, C++, Markdown, Text, HTML, CSS, and Shell.
  2. Console/Terminal/Jobs
    • The Console is a command line interface where you can execute R code one line at time a time and also shows the results of the R script that you ran in the Code Editor. This is normally where one goes to see if the code ran successfully or if there was an error and what error it was.
    • The Terminal tab is where you can execute Shell or Bash command line code directly.
    • Jobs are where you can see the status of any R jobs that you set up. A Job could be as simple as an end-to-end R code that runs from start to finish. You can run a Job in the background while you work on editing other R code simultaneously.
  3. Environment/Connections/History
    • The Environment tab is where you can see which variables, data tables, and data frames you created in your R code. You can view a data table or data frame in the Environment simply by clicking on it to see it.
    • The Connections tab is where you can create connections to a database in SQL Server, PostgreSQL, Google Big Query, Salesforce, Oracle, Spark, or ODBC (open database connection) to name a few.
    • The History tab is a log of all R code that you’ve ran during your session.
  4. Plots and Documentation Viewer
    • This is where you can see the output from your R code that generates plots such as charts and graphs as well as view any Documentation on an R function or package if you need help.


Optional: What other tools would be helpful?

We strongly recommend downloading RStudio to execute the R code contained in Remyx Courses. All of the examples in Remyx Courses provide demos using RStudio in the background.

However, we don’t want to pigeonhole you into using any certain tool, so below are a few alternatives to execute R code. We will leave it up to the learner’s curiosity to research and experiment with the following tools.

Note: you are not required to download or use any of the following in order to complete any of the Remyx Courses.

Alternative ToolDownload Link
R Tools for Microsoft Visual StudioHow To Install
R Extension for Microsoft Visual Studio CodeHow To Install
Jupyter NotebooksHow To Install
R GUIWhen you download R, it comes with a default GUI you can execute code in as well


Optional: How do I update R and RStudio in the future?

Every so often, the R development community makes updates to the R software, and the RStudio team makes updates to the RStudio IDE. To ensure you’re using the most up-to-date versions of R and RStudio to take advantage of new features, you can periodically update R and RStudio within the RStudio IDE itself.

You can update R by following these 3 easy steps:

  1. Open RStudio
  2. Go to File > New File > R Script
  3. In the Code Editor, use the following code below and then click “Run”


R Code To Update To Latest Version of R:

# installs and loads the necessary R package to make updates
install.packages('installr')
library(installr)

# runs a function that updates R automatically and asks you what you want at every decision
installr::updateR()


You can update RStudio by following these 3 easy steps:

  1. Open RStudio
  2. Go to Help > Check for Updates
  3. If there’s a new version of RStudio available, it’ll direct you to the download link where you can complete the update.