Skip to content
KodeTrail

Camp 1 · Step 1 of 12

Why R?

The language built by statisticians, for turning data into understanding.

8 min+50 XP

Most languages were designed by computer scientists for general programming. R is different: it was built by statisticians, for working with data. If your goal is to explore datasets, run analyses, and make charts that reveal the story inside numbers, R was made for exactly that.

Data is a first-class citizen

In most languages, handling a table of data means importing libraries and writing loops. In R, tables (data frames) are built into the language's DNA, and operating on whole columns at once is the normal way to work:

temperatures <- c(18, 22, 19, 25, 21)
mean(temperatures)      # 21 — the average, in one call
max(temperatures)       # 25

No loop. You think in terms of the whole dataset, and R obliges.

Where R shines

  • Science & research — the standard tool across biology, economics, psychology, medicine
  • Statistics — if a statistical method exists, there's an R package for it
  • Data visualizationggplot2 produces publication-quality charts
  • Data journalism — newsrooms use R to analyze and visualize stories

First taste

RCloud run

<- is R's assignment arrow (yes, an arrow!), c(...) builds a collection, and sum/mean operate on the whole thing at once. (Runs in a cloud sandbox.)

Checkpoint

What was R specifically designed for?

What's next

R as a calculator — and the vectors hiding under everything.

Next lesson

Calculator and variables

Estimated 12 min