About R and RStudio

R and RStudio are essential tools for data analysis, statistical computing, and visualization. R provides a powerful, open-source environment for performing complex analyses, while RStudio offers a user-friendly interface, supporting multiple languages and features for coding, documentation, and reproducible research. Mastery of R and RStudio enables users to explore data efficiently, implement statistical methods, and communicate insights effectively in scientific, engineering, business, and research contexts [1], [2].

The Figure 1 presents a visual overview of this introductory material, highlighting the main topics—R, RStudio, Installation, Usage, and Popularity—and their subtopics. It serves as a roadmap for readers, showing how foundational knowledge of R and RStudio connects to practical applications, package management, data analysis workflows, and understanding the broader statistical and computational ecosystem [3], [4].

Figure 1: Mind Map of Introduction to R & RStudio

The mind map above (Figure Figure 1) provides a structured overview of the core topics in this chapter: R, RStudio, Installation, Usage, and Popularity. Each branch and sub-branch highlights essential concepts and practical steps, showing how they interconnect to form a complete understanding of statistical computing and data analysis workflows. By following this visual roadmap, readers can see how mastering the fundamentals of R and RStudio—from installing software and running basic scripts to exploring packages and advanced features—lays the groundwork for effective data analysis, reproducible research, and real-world problem solving. This chapter will guide you step by step through each component, linking theory to hands-on applications and best practices.

Introduction to R & RStudio

R and RStudio are open-source applications widely used in big data and data science. The combination of both allows users to perform complex data analysis and visualization efficiently and easily.

These applications are examples of open-source software, meaning they can be freely used, modified, and distributed. More information about open-source software can be found here: What is Open Source Software?

Brief History of R

The R programming language (Figure 2) was developed in the early 1990s by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand. The goal was to create a better data analysis tool than other statistical languages such as S. R was released in 1995 and quickly gained attention from the statistical community.

Figure 2: Logo R

As an open-source language, R grew rapidly with global contributions. CRAN (Comprehensive R Archive Network), founded in 1997, provides thousands of community packages extending R’s functionality. R’s popularity increased in the early 2000s, expanding into industry and academia.

About RStudio

Launched on February 21, 2011, Figure 3 was founded by J.J. Allaire, also known for his role in early web technologies such as ColdFusion. RStudio has become one of the most popular IDEs for R, offering many features to facilitate data analysis, coding, and dynamic documentation using R Markdown.

RStudio supports multiple programming languages:

  • R: Primary language for data analysis.
  • Python: Via reticulate for data analysis.
  • SQL: With DBI package for database queries.
  • Stan: Via rstan for Bayesian modeling.
  • Julia: With JuliaCall for high-performance computing.
  • Shell (Bash): For system commands in the terminal.
  • HTML/CSS/JavaScript: In R Markdown for web documents.

Installing R and RStudio

Step 1: Download and Install R

Download R:

  • Visit CRAN R
  • Select “Download R for Windows” (or your OS)
  • Click “base” to get the latest version
  • Download the installer according to your system (32-bit or 64-bit)

Install R:

  • Run the downloaded installer
  • Follow on-screen instructions
  • Choose installation directory if needed
  • Click “Finish” when done

Note: Ensure R is correctly installed before proceeding to RStudio.

Step 2: Download and Install RStudio

Download RStudio:

  • Visit RStudio
  • Select “RStudio Desktop”
  • Download the free version (“RStudio Desktop Open Source License”) or paid version as needed

Install RStudio:

  • Run the installer
  • Follow on-screen instructions
  • Choose installation directory if needed
  • Click “Finish” when done

Step 3: Verify Installation

For R:

  • Open R from Start menu or desktop
  • Type version in console and press Enter
  • Ensure the version displayed is up to date

For RStudio:

  • Open RStudio
  • Check that it connects to the installed R
  • Run basic commands like 2 + 2 to ensure functionality

Installation Video

Video: R and Rstudio Installation

Popularity of R

R is widely recognized among data scientists and researchers. Key reasons for its popularity include:

Statistical Analysis and Big Data

R is efficient for statistical and big data analysis (Figure 4) thanks to many supporting packages and libraries.

Figure 4: Dashboard Example

Flexibility and Compatibility

R is flexible and compatible (Figure 5) with multiple platforms, making integration with other software easy.

Figure 5: Flexibility and Compatibility

Active Community

R has a large, active user community providing resources for learning and sharing knowledge.

  • R Project: Official site
  • Mailing Lists: Subscribe for updates about R releases here
  • Twitter #rstats: Active users share insights on Twitter link
  • Tidy Tuesday: Weekly online project for data visualization with open-source datasets link
  • R-Ladies: Global group promoting gender equality in R community link
  • R-Podcast: Podcast with R tips and updates link
  • R-Bloggers: Blog site for sharing R code, analysis, and visualization link

Open Source

As open-source software, R can be freely used and developed, making it ideal for researchers with limited budgets (See Figure 6).

Figure 6: Open Source

Data Visualization

R excels in data visualization (Figure 7), presenting complex data clearly and attractively.

Figure 7: Data Visualization

Suitable for Big Data & ML

As the world of data grows larger and more complex, R keeps pace by offering tools designed for big data and Machine Learning (ML). This Figure 8 highlights R’s strength in combining its statistical roots with modern capabilities, enabling analysts, researchers, and businesses to explore data, build models, and generate insights with confidence.

Figure 8: Big Data & Machine Learning

How to Use R/Studio

To start using R effectively, follow these steps:

  • R: Open the R application from Start menu or desktop to access the console.
  • RStudio: Open RStudio for a graphical interface that simplifies coding and analysis.

Writing and Running Code

  • Klik Console Tab: Enter commands directly in “Console”, Example:
print("Hello, World!")
  • Script Tab: Save and run multiple commands, Example:
# Simple R script
x <- 10
y <- 5
result <- x + y
print(result)

Installing and Loading Packages

  • Install Packages:
install.packages("ggplot2")
  • Load Packages:
library(ggplot2)

Accessing Documentation

  • Function Help:
help(plot)
?plot
  • Vignettes:
vignette("ggplot2")
[1]
Ihaka, R. and Gentleman, R., R: A language for data analysis and graphics, Journal of Computational and Graphical Statistics, vol. 5, no. 3, 299–314, 1996
[2]
Allaire, J. J., RStudio: Integrated development environment for r, https://rstudio.com/, 2011
[3]
Comprehensive r archive network (CRAN), https://cran.r-project.org/, 1997
[4]
RStudio documentation and resources, https://rstudio.com/, 2021