An ordered set of instructions. It reads input, follows rules, and produces output.
Workspace
R
statistics data analysis visualization and research workflows
Definition first
What R means
R is a programming language for writing exact instructions, often used for statistics data analysis visualization and research workflows. Start with one mental model: input goes through steps and becomes output.
analysis.RRun Rscript analysis.RHabit Inspect each vector or data frame before modelingA value is data. A variable is the name you use to hold and reuse that data.
A named piece of work. It takes input, does one job, and can return a result.
Rscript is the place that actually runs code from analysis.R.
First readable code
Program output
entry point output syntax printprint(42)
Output 42Language lineage
R family tree
See where R comes from, which languages feel close, and what to learn next.
Zero base path
Question bank
Search before practice
Pick a stage or search across the open programming bank. Jump straight to the matching drill.
R practice 1
R question 1. Choose the statement that matches printing a value.
R practice 2
R question 2. Choose the statement that matches naming a value.
R practice 3
R question 3. Choose the statement that matches reusable function.
R practice 4
R question 4. Choose the statement that matches basic collection.
R practice 5
R question 5. Choose the statement that matches printing a value.
R practice 6
R question 6. Choose the statement that matches naming a value.
R practice 7
R question 7. Choose the statement that matches reusable function.
R practice 8
R question 8. Choose the statement that matches basic collection.
R practice 9
R question 9. Choose the statement that matches printing a value.
R practice 10
R question 10. Choose the statement that matches naming a value.
R practice 11
R question 11. Choose the statement that matches reusable function.
R practice 12
R question 12. Choose the statement that matches basic collection.
R practice 13
R question 13. Choose the statement that matches printing a value.
R practice 14
R question 14. Choose the statement that matches naming a value.
R practice 15
R question 15. Choose the statement that matches reusable function.
R practice 16
R question 16. Choose the statement that matches basic collection.
R practice 17
R question 17. Choose the statement that matches printing a value.
R practice 18
R question 18. Choose the statement that matches naming a value.
Multiple choice
R practice 1
R question 1. Choose the statement that matches printing a value.
print(42)
Reference
Patterns for analysis.R
Rscript analysis.Rentry point output syntax print
Program output
print(42)
- Run the smallest file first
- Print one known value
- Check the output before adding more code
variables assignment types <-
Values and names
total <- 42 print(total)
- Give values readable names
- Keep one idea per line while learning
- Trace the value before changing it
function collection Vector
Functions and collections
add <- function(a, b) {
a + b
}
scores <- c(40, 2)
print(length(scores))- Keep functions small
- Return useful values
- Use the common collection before reaching for frameworks