Introduction to R Programming: Goal, Code, Verify, Reflect

Guided Activities for Learning R Workflow

Author

Lorraine Gaudio

Published

October 10, 2026

Introduction to R Programming

Goal, Code, Verify, Reflect

Learn R through a visible research workflow

R programming can make the decisions behind an analysis visible. Code records the operations performed on data. Memos record the goals, predictions, checks, questions, and interpretations that shaped the work. Together, code and memos create a traceable account of how an analysis developed.

A traceable record helps you return to your work and understand what you did, why you did it, and what you understood at the time. It also allows other people to inspect the process and attempt to reproduce the computational steps. This ability to account for your methods, decisions, and results is part of your explanatory power as a researcher.

These practices support research integrity. They are especially important when generative AI can produce plausible code quickly. You remain responsible for understanding the code you use, checking its behavior, interpreting its results, and explaining the decisions you make.

You can begin this book without prior programming experience. The guided activities tell you what to do, what to notice, and how to check your work as you learn R.

A repeated learning workflow

The design of this book draws on self-regulated learning. Learning develops through a cycle of planning, working and monitoring, then evaluating and adapting. Four recurring prompts make that cycle visible.

🎯 Goal

Identify what you are trying to accomplish before you begin. When prompted, make a prediction about what you expect the code to do.

⚑ Code

Write and run code that moves you toward the goal. Test ideas deliberately, make changes, and keep a record of useful trials.

βœ… Verify

Inspect the output, objects, files, warnings, and errors produced by your code. Compare what happened with your goal and prediction.

πŸ—£ Reflect

Explain what happened and what you learned. Identify what changed in your understanding, what remains uncertain, and what you will try next.

You will repeat this workflow throughout the book. The cycle helps you develop code that you can inspect, rerun, explain, and revise.

Seven learning skill themes

Programming draws on skills such as persisting through confusion, asking questions, considering alternatives, documenting decisions, and checking details. This book organizes those practices into seven learning skill themes.

Each part of the book highlights one theme. The guided activities show what the skill can look like while learning R and conducting research. You will also encounter prompts that invite you to practice and document the skill yourself.

πŸ’ͺ Tenacity

Stay with challenging work productively. Try a reasonable next step, adjust your approach when needed, and seek help when you reach the limit of what you can resolve alone.

✍️ Transparency

Make your goals, code, checks, reasoning, and decisions visible so that you and others can follow the development of your work.

🦁 Courage

Try unfamiliar tasks, examine errors, ask questions, and share uncertainty while your understanding is still developing.

🧭 Autonomy

Make informed choices, monitor your progress, and take responsibility for understanding and explaining the work you produce.

πŸ€” Open-mindedness

Consider alternative explanations and approaches. Use evidence from your checks to decide whether your thinking or code needs to change.

🐱 Curiosity

Ask questions, investigate patterns, explore possibilities, and use unexpected results as invitations to learn more.

βœ”οΈ Thoroughness

Attend to details, complete important checks, and examine the available evidence before drawing conclusions.

How to read the symbols

The symbols in this book provide consistent cues. They help you recognize what kind of thinking or action a passage is asking you to practice.

Symbol What it asks you to do
🎯 Goal: State what you are trying to accomplish.
⚑ Code: Write, run, or deliberately test code.
βœ… Verify: Check what happened and compare it with what you expected.
πŸ—£ Comment: Explain your code, output, reasoning, or current understanding.
πŸͺž Reflect: Evaluate your learning process and consider future usefulness of content.
πŸ’‘ Tip: Consider a strategy that may make the work clearer or more manageable.
πŸ›  Break Things!: Change something deliberately and observe how R responds.
πŸ“– Review: Return to an earlier idea.
🧐 Notice: Inspect a detail that affects the code, interpretation, or document formatting.
πŸ‘€ Cite: Identify a resource that helped you and explain how you used it.
⚠️ Common Pain Point: Watch for a place where learners frequently encounter confusion.
πŸ›Ÿ Help: Pause and use an appropriate source of support.
🧢 Knit: Create or update the rendered output from an R Markdown document.

The symbols accompany written labels, so you do not need to memorize them before you begin. Their meanings will become familiar as you work through the activities.

What to expect in each chapter

Most chapters follow a consistent sequence:

  1. Read the overview to identify the purpose of the chapter.
  2. Keep the book open next to RStudio.
  3. Complete the guided steps in order.
  4. Type and run the code when prompted.
  5. Pause at the Goal, Verify, Comment, and Reflect prompts.
  6. Keep useful records of errors, code trials, resources, and revisions.
  7. Use the summary and chapter terms when you review.

Some chapters include a Practice Space with additional opportunities to apply the chapter’s ideas. If you are using this book as part of a course, your instructor will provide any requirements, deadlines, or submission directions separately.

Begin reading

Start with the Preface for an introduction to R, RStudio, and the ideas that guide this book. Then enter Tenacity, the first learning skill theme.