I have a CSV with a column format similar to this:
Section | ID | Totaltime | Item1/Word | Item1/Cat | Item1/Time...Item235/Time
I would like to reshape this so that instead of all 235 entries per ID on a single row, there is a row per item, sorted/chunked by ID, so it looks similar to this-
Section | ID0 | Totaltime | Item1/Word | Item1/Cat | Item1/Time
Item2/Word | Item2/Cat | Item2/Time
Item3/Word | Item3/Cat | Item3/Time
...Item235/Word | Item235/Cat | Item235/Time
Section | ID1 | Totaltime | Item1/Word | Item1/Cat | Item1/Time...
I've tried to melt it using the ID as the vars.id argument, and the various Items pulled together with a grepl into the measures.vars argument, but this results in something like this-
Section | ID0 | Totaltime
Section | ID0 | Item1/Word
Section | ID0 | Item1/Cat
Section | ID0 | Item1/Time
...
Section | ID0 | Item235/Word
Section | ID0 | Item235/Cat
Section | ID0 | Item235/Time
I've also tried recasting this, but without much luck.
I'm new to R as of this week, so I'm sure there is probably something super obvious I'm missing, but I've hit a wall on this.