I can't phrase the question well due to my limited English proficiency. However I wanted to see cell association of my dataframe. Meaning, let's say I pick "row a" then how would "rows a"s many associations, and then make a dataframe where each row corresponds to list of its association? I know several dplyr functions like group_by or group_splits, however I couldn't get far with those. Here is my goal:
ex_df <- data.frame(Tracts= c(500, 200, 420, 317, 783, 200, 200, 500, 317, 783),
Cluster = c(1, 2, 3, 4, 4, 5,1, 2 ,4,3))
#gives:
# Tracts Cluster
# 1 500 1
# 2 200 2
# 3 420 3
# 4 317 4
# 5 783 4
# 6 200 5
# 7 200 1
# 8 500 2
# 9 317 4
# 10 783 3
# Now how do I get the dataframe where I can get list (or character vector is ok)
# of cell associations? Something like this:
#Required output:
# Tracts Contained_cluster
# 1 500 1,2
# 2 200 1,2,5
# 3 420 3
# 4 317 4
# 5 783 3,4
I couldn't make a proper search due to lack of English proficiency. If this question is duplicate, please do let me know. Also, if you can re-phrase the question, please feel free. Thankyou.