View source: R/function-factory-helpers.R
absorb_key_args | R Documentation |
If insert_key_args()
is called in the exit area of a function factory
(i.e., after the part that produces the factory-made function),
absorb_key_args()
must be called in the main part. Unlike the former, it
transforms data
, not fun
, and should be reassigned to data
.
absorb_key_args(data, reported, key_cols_call)
data |
User-supplied data frame. |
reported |
String. Names of the key arguments. |
key_cols_call |
User-provided arguments named after one or more key columns. |
It renames key columns that have non-standard names, following user-supplied directions via the arguments automatically inserted below the function.
Data frame data
, possibly with one or more columns renamed.
Remember reassigning the value to data
!
# Not really a meaningful example -- need to use
# the function in very specific places
data <- grim_map(pigs1)
data <- absorb_key_args(data, c("x", "n"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.