Thank you so much- I will try your code.
I did something extremely similar for bottom vegetation categories from fishing surveys (finding all the unique combinations). I adapted it to your data, see attached.
Hope this helps.
On Nov 9, 2018, at 10:59 AM, El Rouby,Nihal M <[log in to unmask]> wrote:
I have a data wrangling question. I have a data set with IDs and the medications each ID had. I’m interested to know how many were on several medications and what are the most frequent combinations of medications. I was able to use to dplyr and summarize to know the number of IDs on one, two, three, four, etc. My question is: Is there a way to get the name of these combinations and their frequency? In other words, X number of individuals were on combination of A+B, X number of individuals were on combinations A+B+C, and so on.
Here is the code I have used and worked for me to get the number on the combinations but I don’t know what these combinations are. I’m attaching a snippet of example data
I appreciate your help.
m <- read_excel("testdata.xlsx")
This list strives to be beginner friendly. However, we still ask that you PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. <testdata.xlsx>