Description Usage Arguments Details
View source: R/rcpp_tapply_generator.R
Use this function as a generator for your own tapply
functions; that is, functions you would like to apply split
over some grouping variable. Note that we restrict
ourselves to the case where we return a scalar as output;
rather than the more general output of tapply
.
1 2 3 4 5 |
fun |
A character string defining the C++ function.
It must be in terms of a variable |
includes |
Other C++ libraries to include. For
example, to include |
depends |
Other libraries to link to. Linking is done through Rcpp attributes. |
returnType |
The return type of your function; note
that we require that the generator returns a scalar value
of type |
inline |
boolean; mark this function as inline? This may or may not increase execution speed. |
name |
An internal name for the function. |
file |
A location to output the file. Defaults to a
temporary file as generated by |
additional |
Other C++ code you want to include;
e.g. helper functions. This code will be inserted as-is
above the code in |
Note that we simplify differently than base R
tapply
: when simplify=TRUE
, we call
unlist
on the output; hence, a named vector is
returned.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.