https://github.com/rstudio/tblcheck
Checks for grading tabular data
https://github.com/rstudio/tblcheck
autograding gradethis learnr tables tibbles
Last synced: 27 days ago
JSON representation
Checks for grading tabular data
- Host: GitHub
- URL: https://github.com/rstudio/tblcheck
- Owner: rstudio
- License: other
- Created: 2021-04-29T16:26:49.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-11T01:29:45.000Z (about 2 years ago)
- Last Synced: 2025-04-22T19:03:42.023Z (about 1 month ago)
- Topics: autograding, gradethis, learnr, tables, tibbles
- Language: R
- Homepage: https://pkgs.rstudio.com/tblcheck
- Size: 2.62 MB
- Stars: 10
- Watchers: 37
- Forks: 1
- Open Issues: 14
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# tblcheck
[](https://CRAN.R-project.org/package=tblcheck)
[](https://github.com/rstudio/tblcheck/actions)tblcheck provides functions for grading tibbles, data frames, and vectors with [gradethis](https://pkgs.rstudio.com/gradethis/).
gradethis is designed for use with [gradethis](https://pkgs.rstudio.com/gradethis/) in [learnr](https://rstudio.github.io/learnr/) tutorials. We recommend that you first be comfortable grading [learnr](https://rstudio.github.io/learnr/) tutorials with [gradethis](https://pkgs.rstudio.com/gradethis/) before you begin using tblcheck. You can learn more with the [gradethis package documentation](https://pkgs.rstudio.com/gradethis/) and the [learnr package documentation](https://rstudio.github.io/learnr/).
## Installation
tblcheck is still in development and not on [CRAN](https://CRAN.R-project.org) yet. The development version of tblcheck can be installed from GitHub with:
``` r
# 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:
```` markdown
```{r setup}`r ""`
library(learnr)
library(gradethis)
library(tblcheck)
library(tibble)
```
````Then include one of the tblcheck functions in your gradethis code:
```` markdown
```{r exercise, exercise = TRUE}`r ""````
```{r exercise-solution}`r ""`
tibble(fruit = "tomato", color = "red")
``````{r exercise-check}`r ""`
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 and `tbl_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](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.