https://github.com/rundel/checklist
https://github.com/rundel/checklist
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rundel/checklist
- Owner: rundel
- License: other
- Created: 2020-06-16T10:18:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-30T00:48:09.000Z (over 1 year ago)
- Last Synced: 2023-10-30T01:36:00.155Z (over 1 year ago)
- Language: R
- Homepage: https://rundel.github.io/checklist
- Size: 612 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - rundel/checklist - (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# checklist
[](https://github.com/rundel/checklist/actions?query=workflow:%22R-CMD-check%22) [](https://github.com/rundel/checklist/actions?query=workflow:%22pkgdown%22)
[](https://github.com/rundel/checklist/actions/workflows/R-CMD-check.yaml)The goal of this package is to provide a variety of tools for checking RStudio project based assignments. These tools are not specifically about testing for the correctness of an assignment, but rather about testing the process and reproducibility of that assignment. For example:
* does the project compile (knit)
* does the project only include the files want
* does the include Rmd document have the correct structure
* and many more## Installation
You can install the the development version of this package from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("rundel/checklist")
```## Example
```{r}
library(checklist)
```Lets look at a simple example of the type of assignment a student might turnin, all of the files are available in `inst/examples/hw1` within this repository, if you have already installed the package then we can also find the directory using `system.file("examples/hw1", package="checklist")`.
```{r}
dir = system.file("examples/hw1", package="checklist")# Show the project contents
fs::dir_tree(dir)
```We can now use `checklist` to express simple checks for the files in this directory. For example if we wanted to make sure that the students submit a knitted version of their homework we could use the following check:
```{r}
check_required_files("hw1.md", dir)
```Alternatively, we may want to prevent the students from turning in a knitted version (to check the reproducibility of their work) and this can be done explicity with
```{r}
check_disallowed_files("hw1.md", dir)
```Alternatively we may instead want to explicity about what files are allowed (ensuring students have not added or renamed anything), then we can
```{r}
check_allowed_files(c("README.md", "fizzbuzz.png", "hw1.Rmd", "hw1.Rproj"), dir)
```By default the package ignores hidden files (files whose name starts with a `.`) but we can also check for these as well using the `all = TRUE` argument.
```{r}
check_allowed_files(c("README.md", "fizzbuzz.png", "hw1.Rmd", "hw1.Rproj"), dir, all = TRUE)
```To refine this, we may want to allow `.gitignore` as well as the `.Rproj.user/` folder. These can be added to the files argument and we can even use standard glob wildcards to make our life easier,
```{r}
check_allowed_files(
c("README.md", "fizzbuzz.png", "hw1.Rmd", "hw1.Rproj", ".gitignore", ".Rproj.user/*"),
dir, all = TRUE
)
```