Description Usage Arguments Details Value Note Author(s)
These operators help in passing arbitrary lists of arguments to
functions, with a more convenient interface than
do.call. The partial application operator allows
saving some arguments with a reference to a function so the
resulting function can be passed elsewhere.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
f |
a function, to be called, or to to have arguments attached to. |
arglist |
A ... object (see |
x |
a vector, optionally with names, or an object of class
|
... |
Other arguments. to be captured without evaluating. |
y |
a ... object as constructed by |
These objects have methods for objects of class ... produced
by dots, so that you may partially apply argument
lists without arguments as yet unevaluated.
For %()%, the result of calling
the function with the arguments provided. When x is a
... object, its contents are passed inithout
evaluating. When x is another type of sequence its elements
are put in the value slots of already-evaluated promises. This is
slightly different behavior from do.call(f,
as.list(x), quote=TRUE), which passes unevaluated promises with
expressions wrapped in link{quote}. This makes a difference
if f performs nonstandard evaluation.
For %<<% and %<<<%, a new function with the
arguments partially applied. For f %<<<% arglist, the
arguments will be placed in the argument list before any further
arguments; for f %<<% arglist the arguments will be placed
afterwards.
curr and curl are standalone functions that
partially apply arguments to functions; curr(f, a=1, b=2) is
equivalent to f %<<% dots(a=1, b=2), and curl is
the "left curry" corresponding to %>>%.
For
%__%, the two operands concatenated together. The result will be
a list, or a dots object if any of the operands are
dots objects.
"Curry" is a slight misnomer for partial function application.
Peter Meilstrup
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.