Apologies if I'm not posting correctly. I'm new to R and this is my first post to stackoverflow. I've read as much as can to find a solution to my problem, but haven't been able to find something I can use.
I have some intensive longitudinal data that I'm trying to reshape. Currently it is in wide format and looks something like this:
Participant D1_1_1 D1_1_2 D1_1_3 D1_1_4 D2_1_1 D2_1_2 etc...
P1 6 2 3 5 1 2
P2 4 9 3 6 4 1
P3 7 4 2 8 1 1
P4 1 5 1 1 6 7
P5 2 0 8 2 1 4
etc..
The column variables refer to responses to a specific survey item, made on a particular day, at a particular times throughout the day.
So:
D1_1_1 = day 1, time 1, item 1
D1_1_2 = day 1, time 1, item 2
...
D4_3_7 = day4, time 3, item 7
In total, the data I have covers: 60 participants who have responded to 11 items, 4 times in a day, for 10 days (a total of 440 data points per participant).
I'm looking to get help on being able to manipulate this effectively into long format, so it could look, for example, like this:
Participant Day time item 1 item 2 ... item 11
P1 1 1 6 2
P1 1 2 X X
P1 1 3 X X
P1 1 4 X X
P1 2 1 1 4
etc..
Where X is the participant's response to a given survey item, on a particular day, at a particular time.
Any help would be much appreciated!
Cheers