Squash one column in a data.frame using other columns as id.

squash(df, column, split = ",")

Arguments

df

data.frame

column

column name, not numeric position

split

split string

Value

data.frame

Examples

df <- data.frame(a = c(1:2, 1:2), b = letters[1:4])
squash(df, "b", ",")
#>   a   b
#> 1 1 a,c
#> 2 2 b,d