spread_column: Spread based on selected variables

Description Usage Arguments Value Examples

Description

Select and spread data

Usage

1
spread_column(df, group_cols, spread_col, spread_val, fill_val = 0)

Arguments

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

Value

dataframe that is spread based on values

Examples

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')

KevinRPan/handy documentation built on May 4, 2019, 2:34 p.m.