This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I have some data that I need to collapse to one row per unique item (say, person) per month. I have a unique code (say, social security number) for each person. However, I have some duplicate observations in each time period, because, perhaps some people have two jobs in a given month. For these cases, I want to combine all of their jobs in that month into one text variable. For example, if the input is:
ID | Month | Job |
---|---|---|
1233 | Jan | Accounting |
1234 | Jan | Waiter |
1234 | Jan | Barber |
1234 | Feb | Barber |
I want the output to be something like:
ID | Month | Job |
---|---|---|
1233 | Jan | Accounting |
1234 | Jan | Waiter/Barber |
1234 | Feb | Barber |
I know how to find the duplicates, but am stuck on how to combine perhaps 2-3 different Jobs, if and when they occur. Thank you for your ideas!
Subreddit
Post Details
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/rprogrammin...