Six Steps to Building Student Confidence in R – zyBooks Guide

Avatar photo Dr. Aimee Schwab-McCoy

Simply put, learning R is hard.  

Many students struggle with it, especially in introductory courses. It might be their first formal data science or statistics class, or even their first exposure to coding.

In this guide, I’ll share six steps to helping your students get comfortable with this important programming language, techniques I’ve gleaned from teaching R myself as a statistics and data science professor, and knowledge I’ve gained leading the data science team here at zyBooks. Before we dive into that, let’s take a look at why R is such a challenge to learn.

In this post

Why is learning R difficult?
How can instructors help students build confidence in learning R?
1. Start early
2. Start small
3. Explain why
4. Explain how
5. Frequent feedback
6. Connect programming and concepts

Why is learning R difficult? 

R is a challenging programming language for a number of reasons:

  • R was written by and for statisticians. The syntax differs from other more common computer science-based programming languages such as Python, C, or Java. So not only is R tough for students who’ve never coded before, even students with prior programming experience can struggle to master it. 
  • R is an open-source language. While this approach offers many advantages (not the least that it’s freely available), what it means is that many different authors have written R packages over the years and contributed to the language’s knowledge base. All these different authors raise even more issues with syntax. For example, similar functions can require different inputs or different structures. This alone is a major challenge. 
  • Most traditional textbooks are language-agnostic. This can benefit instructors by allowing them to decide what language to teach and which software to use. But if they choose R, students will have to refer to external software guides or other material that don’t necessarily map to the learning material, adding even more obstacles to learning. 
  • Students struggle with imposter syndrome. This is common with students studying a programming language. The first time they see an error message they may freeze and think, “I can’t do this.” (Of course, seasoned coders know they’re going to bump up against lots of error messages before their code works!) Layer that on top of the other challenges, and problems snowball.  

How can instructors help students build confidence in learning R? 

The good news is these challenges can be overcome. Here are the six steps I recommend to help your students master R:

1. Start early

A surefire way to build confidence in R is to jump right in! Don’t wait to introduce R. Students will struggle, now or later. As instructors, we can model how to handle that, let them know it’s an expected part of the learning process, and it’s okay. 

Data visualization is a great early topic to use to introduce R; in my experience, it really helps students conceptualize the language. For example, our Applied Statistics with Data Analytics (R) zyBook introduces data visualization in Chapter 2 instead of waiting until later in the course. 

2. Start small 

Long, complicated programs are overwhelming for beginners. Introduce many small programs to reduce the cognitive load. Here at zyBooks, we rely on many small programs at the very beginning of a data science or statistics course that are auto-graded, so feedback is instantaneous. If students are struggling, they will know what’s hanging them up and can iterate and improve – and get used to seeing success. 

In our Data Science Foundations (R) zyBook, we run many small programs to calculate descriptive statistics or carry out a hypothesis test, both excellent gateways to boost confidence in R.

3. Explain why

Students are more motivated to learn R if they understand why it’s important. Explain that real-world data is messy and big, and R is optimized to make sense of it. Show them how R handles variables in a dataset or how R approaches creating a plot, and why it’s a more powerful language for manipulating data than, say, Python. 

Both our Applied Statistics and Data Science Foundations zyBooks draw on real-world datasets that give students invaluable context about the “why” of R.


In this video, Dr. Schwab-McCoy show how real-world datasets help students grasp R: 


4. Explain how

For the most part, R is human readable but difficult to figure out if you’re just starting the language. Solid documentation is essential. But as we talked about above, many authors have contributed to the language’s knowledge base, so tread carefully here and choose docs that build your students’ understanding and confidence, and don’t confuse them. 

At zyBooks, we employ a number of strategies to explain how R works: 

  • Pair comments and plain-text explanations with code to help students translate. 
  • Integrate Jupyter Notebooks in our zyBooks that allow students to run code live, which is particularly useful for longer challenges such as examples with plots.
  • Include R-Function boxes to describe specific functions or conventions by intertwining code with text.

In this video, Dr. Schwab-McCoy explains how Jupyter Notebooks helps students tackle R: 


5. Frequent feedback

Providing students with frequent feedback is crucial for building resiliency and understanding. If your students get feedback right away about what worked – and what didn’t – in their code, they improve and keep pushing forward. What you don’t want to happen is a student getting stuck on their homework on a Friday night and stewing over it all weekend. That’s just fuel to feed frustration with your course, even toward the discipline as a whole. Immediate feedback helps students get out of a rut quickly and sidesteps a negative feedback loop.

Our zyBooks include numerous Participation Activities that ask students to match code with the expected result, fill in the blanks in an R command, or identify R functions for a specific task. Our auto-graded zyLabs allow students to submit their code as many times as they’d like and receive instantaneous feedback, instead of waiting days for an instructor to grade their homework. 

6. Connect programming and concepts

There’s a straight line between understanding how a concept works and how to program it. Especially in R, it’s imperative to link the concepts with code. For example, in R, models and hypothesis tests are executed using what’s known as a formula notation. “y” is the response variable and “x” is the explanatory variable. And the result = method (y ~ x, data = dataframe).

Emphasizing formula notation connects the code format to the variable relationship. That notion of relationships between variables in a data set is essential to helping students figure out what method is needed to answer research questions, and at the same time reinforcing the idea of variable relationships in data science and statistics. 

There are many other ways to leverage programming to reinforce data science and statistics concepts. Both the Data Science Foundations and Applied Statistics zyBooks offer many examples and activities that combine code with interpretation to build better programming intuition. 

Final thoughts

I hope you found this guide helpful! I welcome your feedback and ideas on helping students master R and building their confidence in this important language. Please don’t hesitate to contact me at officehours@zybooks.com

Avatar photo
Author Bio

Dr. Aimee Schwab-McCoy

Before joining zyBooks, Aimee was a statistics professor at Creighton University, where she created a Data Science program. Aimee is an experienced statistics and data science education researcher and passionate about developing engaging resources for data science learners.