0

I have a data table called "vsample.csv" that looks like this: vsample

I need to make a new data set which should look like this: vsample_answer can't really figure out a syntax in R. Can someone help please? Thanks

zx8754
  • 52,746
  • 12
  • 114
  • 209
  • You can use `dcast` from `reshape2` or `data.table` i.e. `dcast(vsample, Subject ~Response.Congruency.with.Cartoon, value.var = "Congruency.percentage")` – akrun Mar 19 '17 at 12:48
  • 1
    Awesome!! Thanks a ton Akrun! – Venkat Kaushik Mar 19 '17 at 12:51
  • 1
    Thank you for merging the question into the existing threads. I didn't know the right vocabulary. – Venkat Kaushik Mar 19 '17 at 13:34
  • Hello Akrun, how do I do the same if I have to do the thing with another column that will have E and H. And the resulting new data table should have E_C, E_IC, H_C and H_IC? The command with Subject~ .(column1, column2) doesn't work. – Venkat Kaushik Mar 19 '17 at 14:05

0 Answers0