function_coverage | R Documentation |
Calculate test coverage for a specific function.
function_coverage(fun, code = NULL, env = NULL, enc = parent.frame())
fun |
name of the function. |
code |
expressions to run. |
env |
environment the function is defined in. |
enc |
the enclosing environment which to run the expressions. |
add <- function(x, y) { x + y }
function_coverage(fun = add, code = NULL) # 0% coverage
function_coverage(fun = add, code = add(1, 2) == 3) # 100% coverage
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.