

In this tutorial we’ll learn how to begin programming with R using RStudio. I hope this post can save some academic lives, or at least save some time, and maybe get some Github’s or RStudio’s attention to this matter.AugTutorial: Getting Started with R and RStudio Additionally, I install the r-cran-digest package that has the SHA1 algorithm.) Sudo apt-get update sudo apt-get remove -y r-base r-base-core sudo apt-get install -y r-base r-base-core r-cran-digest (this removes and installs again the R in the test environment, because if you use the one it is there, some important packages as r-cran-ggplot2 will fail to install. That may be a problem for countries that require that student assignments must be private. That is a limitation (for now) since nbgitpuller doesn’t have access to private repositories. assets/scripts/test.R thenįinally, when you create the auto-grading in your assignment, choose the options: This script can handle several R scripts separately if you want to test for several answers and make partial grading, for example. Use quit(status = 0) and quit(status = 1) to tell the system that the answer is ok or not.Ĭreate a test.sh file that calls the test.R file. My lazy approach makes the student save a file called output.rda containing the variable answer, and my script loads the output.rda file and compares the SHA1 of the answer with the right answer. I’ve tried to leave my files in the template repository, but Github Classroom will currently overwrite them when the student accepts the task.Ĭreate a test.R file, and use your skills to assess the student’s answer. That is not fancy stuff you have to define what is right or wrong and how much.

Github Classroom has an option to create an automatic grading, so the students can push answers for solving the assessment, and the system will automatically verify if it is right.

github/workflows/configure_readme.yml with the following Github action: replace_envs.Īnd, to avoid this action runs in your template, but in student’s fork, add this line before steps: If you generate the README.md from an Rmd file, it is really recommended that you use the plain HTML above since knitr or something else seems to recode the URL, and I could not find a way to disable that.Ĭreate a workflow at. The variables $ are variables that will be automatically replaced by a Github action. Pay attention to the strings you must set: YOUR_USERNAME, YOUR_FORK, YOUR_CLASSROOM.Īlso pay attention that recently, Github is changing the default repository from master to main. You must have a README.md with the following link (adapted from the generated URL from nbgitpuller link generator): RProj file (e.g., Assignment.Rproj).Īnd this name must be the same you set in Step 1 (in last-project-path). There are some requirements to make this work: Step 2 – Create the assignment repository
