'How can I get data from different timepoints (from the same person ) which are in different rows to be in the same row in R?
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).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

