check... | R Documentation |
This function checks that arguments supplied via ... are allowed. This function was written to support other functions, specifically via the return of a helpful error message if arguments that cannot be supplied via ... have been supplied. The function is not intended for general use.
check...(not_allowed, ...)
not_allowed |
A character vector of the names of function arguments that are not allowed. |
... |
Other arguments |
The function checks other arguments supplied via ...; if these contain an argument that is not allowed, the function returns an error. Otherwise, nothing is returned.
Edward Lavender
#### Example (1) Imagine we have a function in wich xlim and ylim cannot be supplied via ...
# Internally, within that function, we can implement check as follows:
pf <- function(...){
check...(not_allowed = c("xlim", "ylim"),...)
plot(1:10, 1:10, xlim = c(1, 10), ylim = c(1, 10),...)
}
# This works:
pf(col = "red")
# This returns an error
## Not run:
pf(col = "red", xlim = c(1, 15))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.