power <- function(x, power) {
return(x^power)
}
foo <- function(x, ...) {
cat("You just called 'foo'\n")
power(x, ...)
}
foo(2, 3)
#> You just called 'foo'
#> [1] 8
foo(2, power = 4)
#> You just called 'foo'
#> [1] 16
foo(2, bar = 123)
#> You just called 'foo'
#> Error in power(x, ...): unused argument (bar = 123)
Last active
January 11, 2018 11:59
-
-
Save DavZim/1f9764eb505a1d3536688b2558add9e5 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment