Description Usage Arguments Value Examples
Select and spread data
1 | spread_column(df, group_cols, spread_col, spread_val, fill_val = 0)
|
df |
the input dataframe |
group_cols |
the columns to group by |
spread_col |
the column to spread by |
spread_val |
the column values to spread |
fill_val |
filling missing with what value |
dataframe that is spread based on values
1 2 | df <- data.frame('id' = c(rep('x',2), rep('y',3),'z'), 'g' = letters[1:6], 'v' = 1:6)
spread_column(df, 'id','g','v')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.