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

Select the short seedlings

0 XP earned
R track: IntermediateMission: IntermediateData framesLogical indexingColumn selection
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 data frame keeps related columns together: each row describes one seedling. The $ operator selects a column. Comparing the height column with 10 creates a logical vector, which then selects matching plant names. Logical indexing lets a single expression apply the same selection rule to every row.

field_notes.R
seedlings <- data.frame(  plant = c("fern", "moss", "ivy"),  height = c(11, 4, 9))short <- seedlings$plant[seedlings$height < 10]cat(paste(short, collapse = " / "), "\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.