Description Usage Arguments Value Note Author(s) Examples
A helper function to wrap ggplot calls, allowing for passing of a shared list of arguments prefixed by an id string. For example, a call to a custom ggplot template may allow for arguments 'line.color' and 'bar.color' to specify the line and bar colors seperately. These arguments are parsed appropriately and passed to the appropriate sub-function.
1 |
_call |
the function to call |
... |
additional arguments to use when calling the provided function |
id |
the prefix string to subset arguments by |
dots |
arguments to subset |
null.empty |
return NULL if no arguments are received |
a call to the specified function with arguments subset for only those which match the specified prefix
Use 'substitute(...())' when collecting parent function ellipses args to pass into 'ggpack()' to accommodate unevaluated symbols.
Ellipses arguments and the arguments passed through the 'dots' args will overwrite previous arguments of the same name.
Doug Kelkhoff kelkhoff.douglas@gene.com
1 2 3 4 5 6 7 8 9 10 11 | library(ggplot2)
# wrap layer calls in a ggpack to package them
ggpack(geom_bar(na.rm = TRUE))
# or more explicitly define layer properties
ggpack(geom_bar, # layer function to bundle
id = 'bar', # name of layer - used for filter listed args
fill = 'red', # ...'s before 'args' used as defaults
dots = list(fill = 'blue'), # named 'args' param will overwrite prior ...'s
fill = 'green') # ...'s after 'args' will overwrite any others
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.