I am getting a little bit puzzled on reshaping my dataframe in R. Let's say I have a dataframe like this:
SVI SDI CVI CDE
12 10 5 3
11 9 4 2
So every column represents a set of sub-variables which I would like to keep distinct now like this:
Value First_letter Second_letter Third_letter
12 S V I
11 S V I
10 S D I
9 S D I
5 C V I
4 C V I
3 C D E
2 C D E
Is there a way to avoid doing this manually? I was thinking of using Reshape2, but I cannot really come up with a way to sort it out. Thanks!