Say that I have a dataframe
xy.df <- data.frame(x = runif(10), y = runif(10))
What I want to do is:
- Create a list of non-redundant items in column 1
- For each item in this list (items in column 1), identify the list of corresponding items in column 2
I have tried some tests with dplyr
but I still don't get it!
df = xy.df %>% group_by(xy.df$x)
Any help would be appreciated.