View source: R/collapse_rows.R
collapse_rows | R Documentation |
This function folds values of a many to one relationship together in a single character composed of comma separated values.
collapse_rows(df, group_by_var, many_mapping_col)
df |
dataframe, tibble, The data structure to work on |
group_by_var |
tidy-eval, character The variable to group by |
many_mapping_col |
The column of values that will collapse into a list. |
The inputs can be anything that can be input into the paste function.
The inputs pasted together as a character string.
#example data nodes_tot=data.frame( FirstName=sample(c('A','B','C'),size = 50,replace=TRUE), LastName=sample(c('1','2','3'),size = 50,replace=TRUE), Latitude=sample(c('D','E','F'),size = 50,replace=TRUE), Longitude=sample(c('4','5','6'),size = 50,replace=TRUE)) #--------- collapse_rows(nodes_tot,FirstName,Longitude)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.