0

Participants filled out a questionnaire at 3 timepoints and now i have 3 rows for each participant. I tried to change my data from long to wide format but it hasn't worked yet.

I tried this code:

rise_wide<-pivot_wider(ris, 
                       id_cols= pid, 
                       values_from = c (ris_1, ris_2, ris_3, ris_4, ris_5,ris_6,ris_7,ris_8, ris_9, ris_10,ris_11,ris_12,ris_13, ris_14, ris_15,ris_16, ris_17))

But instead of creating new variables I now have 3 values for each variable (see picture).

enter image description here

Sotos
  • 47,396
  • 5
  • 31
  • 61
  • Welcome @Mara, Is it possible to share data, or part of it? See: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – jassis Feb 22 '22 at 10:49

0 Answers0