View source: R/AddFunctionToPkg.R
Add a new function named strFunctionName to a package. This function creates a file named R/strFunctionName.R and adds a test function in the file tests/testthat/test-strFunctionName.R to be used with the testthat package.
1 2 3 4 5 6 7 | AddFunctionToPkg(
strFunctionName = "MyNewFunction",
strFunctionDescription = "Add Description",
strPkgDir = getwd(),
strFunctionTemplate = NULL,
strTestTemplate = NULL
)
|
strFunctionName |
The name of the function to add. |
strFunctionDescription |
A description to include at the top of the file with the function. |
strPkgDir |
The directory of the package to add the function to. If this parameter is left blank then the current working directory will be used. |
strFunctionTemplatePath |
Path to a function template. /inst/Templates/FunctionTemplate.R used as default. |
stTestTemplatePath |
Path to a test template. /inst/Templates/TestTemplate.R. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.