new_r + new_testnew_r_test(fun, r.path = "R", r.file.name = NULL, test.path = "tests/testthat", test.file.name = NULL)
function or character string naming the
function."R" for ease of use within RStudio.fun + ".R".
This can be changed by supplying a file name to file.name."tests/testthat" for ease of use within RStudio.fun + ".R".
This can be changed by supplying a file name to file.name.Generates ____.R and test-____.R files.
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.
dir.create("temp_dir") new_r_test(paste, r.path = "temp_dir", test.path = "temp_dir")R file created: temp_dir/paste.R test file created: temp_dir/test-paste.Rnew_r_test("myfun", r.path = "temp_dir", test.path = "temp_dir")R file created: temp_dir/myfun.R test file created: temp_dir/test-myfun.Runlink("temp_dir", TRUE, TRUE)