title: 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?
body: <p>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.</p>
  <p>I tried this code:</p>
  <pre class="lang-r prettyprint-override"><code>rise_wide&lt;-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))
  </code></pre>
  <p>But instead of creating new variables I now have 3 values for each variable (see picture).</p>
  <p><a href="https://i.stack.imgur.com/RP9z5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RP9z5.png" alt="enter image description here" /></a></p>