Concatenate text by a common key
gather_df_lines.RdThis function concatenates text spread across multiple rows based on a common key, using only base R functions.
Arguments
- df
A data.frame containing the data
- key_colname
characterThe column used as the grouping key (character string)- text
characterThe column containing the text to be concatenated (character string)- sep
characterThe separator used to concatenate the text (default is " ")- trimws
logical, default =TRUEIfTRUE, suppress leading, tail and double white spaces- text_colname
characterThe colname for the concatened text column (default is "content")