Description Usage Arguments Value Author(s) See Also Examples
This function computes the "length" of the function. This can be the number of top-level expressions in the body or the total number of expressions computed recursively on all of the body.
When working recursively, we can get the total number of expressions or the number for each of the top-level expressions separately as a vector.
1 | functionLength(e, sum = TRUE, recursive = TRUE)
|
e |
the function object whose length is of interest.
This can also be the name of the function which is then used via |
sum |
a logical value indicating whether to cumulate the
results from the individual top-level expressions. This is only
used when |
recursive |
a logical value controlling whether we
return the number of top-level expressions ( |
An integer vector.
If recursive
is FALSE
, this is a single number
giving the number of top-level expressions in the body.
If recursive
is TRUE
and sum
is TRUE
,
this is the total number of sub-expressions at all levels in the body.
If sum
is FALSE
, the resulting vector has as many elements
as there are top-level expressions in the body. The value for each element is the number of
recursive sub-expressions for the corresponding top-level expression.
Duncan Temple Lang
1 2 3 | functionLength(functionLength)
functionLength(functionLength, recursive = FALSE)
functionLength(functionLength, FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.