R Introduction

What is R?

R is an open-source programming language and environment used for statistical computing and graphics. It was initially developed at the University of Auckland, New Zealand, and is now widely used in academia and industry.

Why Use R?

  • Ideal for data analysis and visualization
  • Used in statistical modeling, machine learning, and bioinformatics
  • Strong support from open-source community
  • Free and platform-independent

Features of R

  • Data frames and vectorized operations
  • Powerful plotting libraries like ggplot2
  • Thousands of packages via CRAN
  • Script-based for automation and reproducibility

R vs. Other Languages

R is particularly strong for statistics, whereas Python is more general-purpose. R is often favored in research and academia for its modeling capabilities.

Running R Code

You can write and execute R scripts in:

  • RStudio (most popular IDE)
  • Command line or terminal using R
  • Online interpreters or Jupyter Notebooks with R kernel
# Simple R command
print("Hello, R!")

Real-World Applications

R is widely used in:

  • Healthcare (e.g., disease outbreak modeling)
  • Finance (e.g., risk analysis)
  • Marketing (e.g., customer segmentation)
  • Government and policy (e.g., census data analysis)

Need Help?

Ask the AI if you need help understanding or want to dive deeper in any topic