tblcheck provides functions for grading tibbles, data frames, and vectors with gradethis.
gradethis is designed for use with gradethis in learnr tutorials. We recommend that you first be comfortable grading learnr tutorials with gradethis before you begin using tblcheck. You can learn more with the gradethis package documentation and the learnr package documentation.
Installation
tblcheck is still in development and not on CRAN yet. The development version of tblcheck can be installed from GitHub with:
# install.packages("remotes")
remotes::install_github("rstudio/tblcheck")
Usage
To use tblcheck in a learnr tutorial, start by loading tblcheck after learnr and gradethis in the setup
chunk of your tutorial:
Then include one of the tblcheck functions in your gradethis code:
```{r exercise, exercise = TRUE}
```
```{r exercise-solution}
tibble(fruit = "tomato", color = "red")
```
```{r exercise-check}
grade_this_table()
```
grade_this_table()
compares the .result
generated by a students’ code to the .solution
generated in the exercise-solution
chunk.
grade_this_table()
passes the student’s.result
if it’s identical to the.solution
, or if a difference is detected, it produces a failing grade with a message describing the problem with the table.grade_this_table()
is built on gradethis functions andtbl_grade()
, which can be used in exercise grading code to detect problems in tables.tbl_grade()
, in turn, is built on lower-level functions that can be used directly to compare specific aspects of two tables.
Learn more about the various tblcheck functions in vignette("tblcheck")
.
Code of Conduct
Please note that the tblcheck project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.