Description Usage Arguments Value References See Also Examples
Quickly produce a roxygen2 style
‘.R’ and
testthat style test
‘.R’ template files from a function
(output file
will include the function) or a character string. Wraps new_r
and
new_test
function capabilities into one function call.
1 2 | new_r_test(fun, r.path = "R", r.file.name = NULL,
test.path = "tests/testthat", test.file.name = NULL)
|
fun |
A |
r.path |
Path to directory to generate the function test in. Default is
to use |
r.file.name |
By default the file is named the same as |
test.path |
Path to directory to generate the function test in. Default is
to use |
test.file.name |
By default the file is named the same as: |
Generates ‘____.R’ and ‘test-____.R’ files.
http://r-pkgs.had.co.nz/man.html
http://r-pkgs.had.co.nz/tests.html
Other new functions: new_data
,
new_r
, new_test
,
new_vignette
1 2 3 4 | dir.create("temp_dir")
new_r_test(paste, r.path = "temp_dir", test.path = "temp_dir")
new_r_test("myfun", r.path = "temp_dir", test.path = "temp_dir")
unlink("temp_dir", TRUE, TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.