Description Usage Arguments Value Examples
Simple Pivot Data Transformation
1 | simple_pivot(df, row_vars, col_vars, value_variable, value_function)
|
df |
Data frame object to transform |
row_vars |
Character vector naming the row variable(s) |
col_vars |
Character vector naming the column variable(s) |
value_variable |
Length 1 character vector naming the column with the value to summarise in table cells |
value_function |
Function that takes a single vector of values as first (and only required) argument and returns a single summary value (the base r 'mean' function, for example). Used to summarise the 'value variable' (by row/column group). |
a tibble/data.frame with the pivot operation applied to it
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.