View source: R/function-factory-helpers.R
| absorb_key_args | R Documentation |
absorb_key_args() is superseded by function_map(), whose mappers
rename key columns themselves.
Call it in a handwritten mapper. If a key argument such as x names a
column of data, it renames that column to the key argument's name, so
that the rest of the mapper finds it.
absorb_key_args(data, reported, key_cols_call = NULL)
data |
Data frame passed to the mapper. |
reported |
String. Names of the key arguments. |
key_cols_call |
Optionally, a named character vector that maps key
argument names to the columns of |
data, possibly with columns renamed. Reassign the result to
data.
df <- tibble::tibble(mean = c(5.19, 4.56), n = c(28, 30))
absorb_key_args(df, c("x", "n"), key_cols_call = c(x = "mean"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.