I appreciate your reply and thank you for your welcome! I also apologize if i wasn't clear enough in my first post, but please bare with me.
I am trying to apply what you have given to my data set, which is more complicated. so I am getting an error:
I am getting an error: Column 'temp' must be length 1 (the group size), not 8
So, I'll make my question more relevant to my data set if you don't mind.
In my data set I have columns: person, id, day, person_count. The ultimate goal is to have every person have 5 rows -- one for every weekday (mon,tue,...,fri)
So my logic is if someone has only one record say (mon), he/she will have a person_count of 1,
so add 4 more rows one for each of (tue,wed,thrs,frid), but if a person has 2 records (one for mon and one for wed), add 3 more records for the remaining days of the week (ie tue, thrs, frid). If someone has an a person_count of 5, then there is no problem there, don't add anything. Last but not least, there are cases where a person has a record, but no day is shown. It simply shows as an NA.
In this case, add 5 more columns one column for each day (i'll delete the 6th column with NA later) since again the ultimate goal is to have every person have 5 rows one for every day. OR simply substitute the NA with one of the days and add four more rows for the remaining days.
Does that help ? If not is there anything i can do to make things easier?