Closing Thoughts
Every lesson in this course has been one consequence or another of a single fact: R has no scalars, only vectors, and its arithmetic, indexing, data frames, and even its NA handling are all shaped by that choice. Vectorized operations replace loops for ordinary per-element work. Negative indices exclude rather than count backward. Logical vectors double as selection masks. Data frames are just equal-length vectors wearing a table's clothing. Factors are integers with a fixed set of labels attached. And NA propagates on purpose, so missing data never gets silently averaged away without you opting in with na.rm.
cat("Vectors:", c(1, 2, 3), "\n")
cat("Done learning R basics.\n")
Vectors: 1 2 3 Done learning R basics.
From here, the natural next steps are the tidyverse (dplyr for data frame manipulation, ggplot2 for visualization) and R's extensive statistical modeling functions (lm() for linear regression and beyond) — all of which lean even further into the vectorized, data-frame-centric style this course has been building toward. Try the practice exercise below, then head back to the compiler to keep experimenting on your own.
Practice exercise
Read a line from stdin into name using readLines(con = "stdin", n = 1), then print "Goodbye, " followed by name, followed by "! Keep exploring R."