Color theme
0 day streak0 XPP1
RLearn mode
MISSION 1 OF 1

Average the pollen readings

0 XP earned
R track: IntermediateMission: BeginnerNumeric vectorsArithmetic meanAssignment
Before you start this intermediate track

Numeric vectors and basic averages. Read data-frame columns and logical filters.

Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.

x
0 / 2 challenges
LEARN THE CONCEPT

Understand it, then try it.

A field researcher records three pollen readings in one numeric vector. The c function combines values, and mean calculates their arithmetic average. Assign the result with <-, then use cat to print a clean report. This is a first step toward describing a larger collection of measurements.

field_notes.R
pollen <- c(3, 6, 9)average <- mean(pollen)label <- "Average:"cat(label, average, "\n")

Each mission is a separate base R script. Run it with Rscript; no packages or input files are needed. Quiz answers show the text printed by cat, without a console prompt.

Track the values line by line. Predict the result before running this example in your own editor.