Description Usage Arguments Examples
View source: R/create_testfile.R
Use a spreadsheet to create files for use with the testthat package.
1 2 3 4 5 6 7 8 | create_testfile(
ss,
sheet,
manipulator = NULL,
filename = NULL,
filepath = NULL,
overwrite = FALSE
)
|
ss |
dribble or filepath. |
sheet |
character (vector). The names of the sheets to be read. |
manipulator |
a function that manipulates the testdata once it has been read from the spreadsheet |
filename |
character (vector). The default is testsheet_<sheet>.R. The number of given filenames must match the length of testdata. |
filepath |
character. The defallt is the current working directory |
overwrite |
boolean. The default is FALSE. |
1 2 3 4 5 6 | ss_path <- testsheets_example("excel")
drop_param_y <- function(testdata) {
testdata <- testdata %>% dplyr::select(-dplyr::starts_with("param_y"))
}
filename <- "testsheet_sum_x_only.R"
create_testfile(ss_path, sheet = "sum", manipulator = drop_param_y, filename=filename)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.