0

We have observational data of a varying number of sequences of videodata entered via a survey system. The data we get is one row per sequence. We need to restructure the data so that the data pertaining to each video follows in order of sequence in one row for each of the differing videodata they pertain to.

Example of how we get our data:
Video X Sequence 1
Video Y Sequence 1
Video X Sequence 2
Video Y Sequence 2
Video X Sequence 3

How we need our data:
Video X Sequence 1 - Video X Sequence 2 - Video X Sequence 3
Video Y Sequence 1 - Video Y Sequence 2 etc.

Given the amount of data we have to re-structure (700 videorecordings, 2-4 sequences each, + 10% double scores (where there are two versions of the data for each sequence)) doing it manually will take a looong time. Any experts out there who know of a simpler way to restructure our data? We have a ~basic understanding of R.

We haven't tried anything yet. This is us shouting into the void in hopes of some deity showing us pity and pointing us in the direction of salvation.

Øyvind
  • 1
  • 1
  • 1
    Please provide enough code so others can better understand or reproduce the problem. – Community Dec 01 '22 at 13:44
  • I'm unsure. "Video X Sequence 1" (vXs1) would be the name of the data row and it would contain a given amount of variables, say varA-varZ. What we would need is for each row pertaining to one video (vXs1-4) to follow on a single row with their corresponding variables separating them (vXs1, varA, ..., varZ, vXs2, varA, ..., varZ, vXs3, varA, ..., varZ). Would `reshape` be able to do this? – Øyvind Dec 01 '22 at 14:06

0 Answers0