Description Usage Arguments Details Author(s) See Also Examples
This function is taken from the lcolladotor/dots package. It is the only function used from this package and is added to this package wholesale to reduce user installation burden. Please use the original package from Github if you use this in your own work.
1 |
name |
Name of the advanced argument to look for in |
value |
The default value of the advanged argument. If this advanced
argument is used in several of your functions, we recommend using
|
... |
Advanced arguments. See dotsMethods. |
From the ...
argument used in your function, find if a specific
argument was included and extract its value.
Note that you can make dots() even more powerful by using getOption
to define value
. This is particularly useful if you use the
same advanced argument in several functions.
L. Collado-Torres
dotsMethods
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Simple example that calculates the max between 'x' and 'y' with a
## specified minimum value to return.
minMax <- function(x, y, ...) {
minValue <- dots('minValue', 0, ...)
res <- max(x, y, minValue)
return(res)
}
minMax(1:2, 3:4)
minMax(1:2, 3:4, minValue = 5)
## Arguably these examples are simple, but the idea is that dots()
## can simplify very long function calls where some parameters will be used
## by a minority of the users.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.