test_files: Test all tasks in all rmarkdown files

Description Usage Arguments Author(s) Examples

Description

This function takes all files in directory, searches all kye_words using key_word_prefix argument and then tests associated with all keywords r chunks. Then function compare the results with the expected value and return a dataframe containing file name, author, check results and number of corrected answers.

Usage

1
2
test_files(expectations, files = list.files(), keyword_prefix = "### ",
  group = FALSE)

Arguments

expectations

an expected values.

files

an rmarkdown files. By dafault is all .Rmd files in a working directory.

keyword_prefix

a common part of all keywords. By default is "### ".

group

logical. If TRUE, function searches first line with the "group:" argument and returns it in the summary.

Author(s)

George Moroz <agricolamz@gmail.com>

Examples

1
2
3
4
5
6
7
8
my_files <- c(
system.file("extdata", "test_1.Rmd", package = "AssignmentCheck"),
system.file("extdata", "test_2.Rmd", package = "AssignmentCheck"),
system.file("extdata", "test_3.Rmd", package = "AssignmentCheck"),
system.file("extdata", "test_4.Rmd", package = "AssignmentCheck")
)
fit <- lm(mpg~cyl, mtcars)
test_files(expectations = list(2+2, fit$coefficients), files = my_files)

agricolamz/AssignmentCheck documentation built on May 10, 2019, 7:34 a.m.