R for Data Science

Context: FIT1043_MOC · the unit’s second language for the value chain · the statistician’s counterpart to Python

Quick Revision

  • 🎯 Objective: justify R as a data-analysis language and set it up âž” statistics-first, interpreted, open-source.
  • ⚡ Key Constraint: R vs Python is a fit-for-purpose choice — R for statistics/analysis, Python for building/deploying systems.

📝 Core

  • What R is âž” a language for analysing and visualising data; interpreted (scripting — no compile step); designed by statisticians; open-source and very popular.
  • Style âž” functional, with more data-analysis and statistical support built in (Python is object-oriented and relies more on packages).
  • Setup âž” RStudio Cloud (browser) or install R (r-project.org) + the RStudio IDE; run via the R console/RStudio or R in a shell.

⚖️ Core Decision Matrix

AspectRPython
Objectivedata analysis & statisticsdeployment & production
Strengthready statistical librariesbuilding models from scratch
Packagestidyverse, ggplot2, caret, zoopandas, scikit-learn, TensorFlow
Weaknessslower, steep curve, dependency clashesfewer specialised stats packages

⚠️ Common Mistakes

  • đź’ˇ Pick by task, not fashion âž” statistics/exploratory analysis leans R; production pipelines/general programming lean Python (no single best tool).
  • đź’ˇ Interpreted ≠ fast âž” R trades raw speed for interactive, statistics-friendly scripting.

đź§  Active Recall