Description Usage Arguments Author(s) Examples
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.
1 2 | test_files(expectations, files = list.files(), keyword_prefix = "### ",
group = FALSE)
|
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. |
George Moroz <agricolamz@gmail.com>
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.