test_farg | R Documentation |
Test whether function has certain arguments
test_farg(fun, arg, dots = TRUE)
fun |
function |
arg |
characters of function arguments |
dots |
whether |
a <- function(n = 1){}
# Test whether `a` has argument called 'b'
test_farg(a, 'b')
# Test whether `a` has argument called 'b' and 'n'
test_farg(a, c('b', 'n'))
# `a` now has dots
a <- function(n = 1, ...){}
# 'b' could goes to dots and a(b=...) is still valid
test_farg(a, 'b')
# strict match, dots doesn't count
test_farg(a, 'b', dots = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.