In today’s data-driven world, students across a range of disciplines are increasingly required to understand data manipulation, statistical analysis, and visualization.
R programming serves as a powerful tool to equip them with these skills, fostering critical thinking and technical abilities in data science. By implementing automatic grading for R assignments, you can streamline grading processes and provide timely feedback, allowing students to focus on learning these essential skills.
R is used in courses like:
- Data Science and Data Analysis: R is essential in data science courses for statistical analysis, data visualization, and predictive modeling, making it a go-to for students learning to analyze complex datasets.
- Statistics and Mathematics: Courses in statistics and quantitative methods often include R, as it allows students to apply statistical techniques and visualize their results.
- Bioinformatics and Life Sciences: With large datasets becoming the norm in biology and genomics, R is commonly used to analyze and visualize biological data.
- Public Health and Epidemiology: Public health courses often use R to teach students data analysis and visualization skills necessary for interpreting health data and understanding disease patterns.
- Psychology and Social Sciences: R is increasingly included in social science courses, enabling students to conduct statistical analyses on research data and interpret their findings effectively.
- Economics and Finance: R is also popular in economics and finance for analyzing time series data, running simulations, and creating financial models.
How can students learn?
As we’ve seen, many students learning R come from disciplines outside of traditional computer science courses. This makes the role of assessment and feedback even more crucial for beginner coders. It can be an intimidating skill to learn with a steep learning curve.
Students benefit from small frequent practice opportunities to build their confidence and get them used to writing code. Having automatic feedback at every stage supports this process and prepares them for larger projects.
CodeGrade’s lightweight IDE integrates into your LMS, giving students instant feedback when they run their code. You can do this using our Quiz feature, where students write their code snippet. When they press “Run”, their code executes automatically against the tests you defined. Use an Input/Output test to verify the accuracy of your students' programs, ensuring they produce the correct results for their solutions.
In this assignment, students work with a .csv file containing financial data from a record store. They are tasked with calculating the total profits and finding the average price per CD.
Here’s how we set it up.
Step 1: Install R
In the setup tab, we install R with the following script:
set -e
sudo apt update
sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common
sudo apt-key adv --keyserver
keyserver.ubuntu.com
--recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb
https://cloud.r-project.org/bin/linux/ubuntu
focal-cran40/'
sudo apt install r-base
This script ensures that R is sourced from the official repository, allowing us to download the latest version of the R Project for Ubuntu 20.04.
Step 2: Upload additional files
Here, we upload the .csv file containing the data that students will work with, which will be used for our tests. This setup means students won’t need to upload the .csv file themselves—they only need to submit their R code.
Now we move to the tests tab.