View source: R/ggplot-helper.R
| element_vec | R Documentation |
For an element object, some fields are
vectorized, while others are not. This function allows you to apply a
function to the vectorized fields.
The following helper functions are available:
element_vec_fields: Identify which fields are vectorized. Developers
should implement this when creating new element classes.
element_vec: Apply a custom function .fn to vectorized fields.
element_rep: Applies rep().
element_rep_len: Applies rep_len().
element_vec_recycle: Applies vec_recycle().
element_vec_rep: Applies vec_rep().
element_vec_rep_each: Applies vec_rep_each().
element_vec_slice: Applies vec_slice().
element_vec_fields(.el, ...)
element_vec(.el, .fn, ...)
element_rep(.el, ...)
element_rep_len(.el, length.out, ...)
element_vec_recycle(.el, size, ...)
element_vec_rep(.el, times, ...)
element_vec_rep_each(.el, times, ...)
element_vec_slice(.el, i, ...)
.el |
An |
... |
Additional arguments passed on to |
.fn |
The function to be applied to the vectorized fields of the element object. |
length.out |
Non-negative integer. The desired length of the output
vector. Other inputs will be coerced to a double vector and the first element
taken. Ignored if |
size |
Desired output size. |
times |
For For |
i |
An integer, character or logical vector specifying the
locations or names of the observations to get/set. Specify
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.