19/2/2025

Evolution of R: Origins!

  • Created in 1993 by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand.

  • Inspired by the S programming language.

  • Designed for statistical computing and data analysis.

Growth of R

  • Open-source and free under the GNU General Public License.

  • CRAN (Comprehensive R Archive Network) established in 1997 to distribute packages.

  • Over 18,000 packages available as of 2023.

Popularity of R

  • Widely used in academia, industry, and data science.

  • Key areas: statistics, machine learning, data visualization, and bioinformatics.

  • Supported by a large and active community.

Key Features of R

  • Extensive statistical libraries.

  • Data visualization capabilities (Base plot, ggplot2, Plotly, others).

  • Reproducible research with RMarkdown.

  • Integration with other languages like Python and C++.

Common uses of R

  • Data analysis and cleaning.

  • Statistical modeling and hypothesis testing.

  • Data visualization (graphs, charts, and dashboards).

  • Report generation with RMarkdown.

Instaling R and Rstudio on Windows

Downloading R

Installing R

  • Follow the installation wizard.

  • Accept the default settings.

  • Verify the installation by opening R from the Start menu.

Downloading Rstudio

Installing RMarkdown and Required Packages

install.packages(“rmarkdown”) install.packages(“knitr”) install.packages(“tinytex”) tinytex::install_tinytex()

Verifying the installation

  • Open RStudio and create a new RMarkdown file (File > New File > RMarkdown).

  • Compile the file to HTML, PDF, or Word to ensure everything works.

Publishing with Rpubs

What is Rpubs?

  • A free platform to publish and share HTML documents created with RMarkdown.

  • No need for a web server or hosting.

Creating an Rpubs Account

  • Go to https://rpubs.com.

  • Click on Sign Up and create an account using your email or GitHub.

Publishing a Document

  • Create an RMarkdown file in RStudio.

  • Click Knit to generate an HTML file.

  • Click the Publish button in the Viewer pane and select Rpubs.

Sharing Your Work

  • Each document gets a unique URL.

  • Share the link with colleagues or embed it in websites.

Benefits of Rpubs

  • Easy to use and free.

  • Great for sharing reports, tutorials, and dashboards.

  • Encourages reproducible research.

A basic example

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

A basic example

Example 2

library(datasets) data(airquality) summary(airquality) pairs(airquality)

Thanks!