title: Want to use pivot-wider but it's not really working
body: <p>My original data looks like this:
  <a href="https://i.stack.imgur.com/pWftz.png" rel="nofollow noreferrer">original data</a></p>
  <p>It's a very long dataset, the # of sections repeat every 10 times. I tried to pivot the data to a format like this:
  <a href="https://i.stack.imgur.com/0RXed.png" rel="nofollow noreferrer">desired format</a></p>
  <p>When I use pivot-wider, it gives me Nas all over.... How can I get the data pivoted?
  Here's the original data:</p>
  <pre><code>df1 &lt;- structure(list(ID = 1:60, Num_of_section = c(1L, 2L, 3L, 4L, 5L, 
  6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 
  1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 
  6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 
  1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L), Data = c(123L, 434L, 
  545L, 2323L, 54L, 23L, 54L, 24L, 53L, 44L, 132L, 44L, 543L, 335L, 
  53L, 33L, 42L, 24L, 35L, 55L, 12L, 143L, 533L, 344L, 232L, 5332L, 
  23L, 333L, 56L, 75L, 123L, 434L, 545L, 2323L, 54L, 23L, 54L, 
  24L, 53L, 44L, 132L, 44L, 543L, 335L, 53L, 33L, 42L, 24L, 35L, 
  55L, 12L, 143L, 533L, 344L, 232L, 5332L, 23L, 333L, 56L, 75L)), class = &quot;data.frame&quot;, row.names = c(NA, 
  -60L))
  </code></pre>
  <p>This is the input I'm getting now:</p>
  <pre><code>noa &lt;- structure(list(X..of.section = 1:10, `1` = c(123L, NA, NA, NA, 
  NA, NA, NA, NA, NA, NA), `2` = c(NA, 434L, NA, NA, NA, NA, NA, 
  NA, NA, NA), `3` = c(NA, NA, 545L, NA, NA, NA, NA, NA, NA, NA
  ), `4` = c(NA, NA, NA, 2323L, NA, NA, NA, NA, NA, NA), `5` = c(NA, 
  NA, NA, NA, 54L, NA, NA, NA, NA, NA), `6` = c(NA, NA, NA, NA, 
  NA, 23L, NA, NA, NA, NA), `7` = c(NA, NA, NA, NA, NA, NA, 54L, 
  NA, NA, NA), `8` = c(NA, NA, NA, NA, NA, NA, NA, 24L, NA, NA), 
      `9` = c(NA, NA, NA, NA, NA, NA, NA, NA, 53L, NA), `10` = c(NA, 
      NA, NA, NA, NA, NA, NA, NA, NA, 44L), `11` = c(132L, NA, 
      NA, NA, NA, NA, NA, NA, NA, NA), `12` = c(NA, 44L, NA, NA, 
      NA, NA, NA, NA, NA, NA), `13` = c(NA, NA, 543L, NA, NA, NA, 
      NA, NA, NA, NA), `14` = c(NA, NA, NA, 335L, NA, NA, NA, NA, 
      NA, NA), `15` = c(NA, NA, NA, NA, 53L, NA, NA, NA, NA, NA
      ), `16` = c(NA, NA, NA, NA, NA, 33L, NA, NA, NA, NA), `17` = c(NA, 
      NA, NA, NA, NA, NA, 42L, NA, NA, NA), `18` = c(NA, NA, NA, 
      NA, NA, NA, NA, 24L, NA, NA), `19` = c(NA, NA, NA, NA, NA, 
      NA, NA, NA, 35L, NA), `20` = c(NA, NA, NA, NA, NA, NA, NA, 
      NA, NA, 55L), `21` = c(12L, NA, NA, NA, NA, NA, NA, NA, NA, 
      NA), `22` = c(NA, 143L, NA, NA, NA, NA, NA, NA, NA, NA), 
      `23` = c(NA, NA, 533L, NA, NA, NA, NA, NA, NA, NA), `24` = c(NA, 
      NA, NA, 344L, NA, NA, NA, NA, NA, NA), `25` = c(NA, NA, NA, 
      NA, 232L, NA, NA, NA, NA, NA), `26` = c(NA, NA, NA, NA, NA, 
      5332L, NA, NA, NA, NA), `27` = c(NA, NA, NA, NA, NA, NA, 
      23L, NA, NA, NA), `28` = c(NA, NA, NA, NA, NA, NA, NA, 333L, 
      NA, NA), `29` = c(NA, NA, NA, NA, NA, NA, NA, NA, 56L, NA
      ), `30` = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, 75L), `31` = c(123L, 
      NA, NA, NA, NA, NA, NA, NA, NA, NA), `32` = c(NA, 434L, NA, 
      NA, NA, NA, NA, NA, NA, NA), `33` = c(NA, NA, 545L, NA, NA, 
      NA, NA, NA, NA, NA), `34` = c(NA, NA, NA, 2323L, NA, NA, 
      NA, NA, NA, NA), `35` = c(NA, NA, NA, NA, 54L, NA, NA, NA, 
      NA, NA), `36` = c(NA, NA, NA, NA, NA, 23L, NA, NA, NA, NA
      ), `37` = c(NA, NA, NA, NA, NA, NA, 54L, NA, NA, NA), `38` = c(NA, 
      NA, NA, NA, NA, NA, NA, 24L, NA, NA), `39` = c(NA, NA, NA, 
      NA, NA, NA, NA, NA, 53L, NA), `40` = c(NA, NA, NA, NA, NA, 
      NA, NA, NA, NA, 44L), `41` = c(132L, NA, NA, NA, NA, NA, 
      NA, NA, NA, NA), `42` = c(NA, 44L, NA, NA, NA, NA, NA, NA, 
      NA, NA), `43` = c(NA, NA, 543L, NA, NA, NA, NA, NA, NA, NA
      ), `44` = c(NA, NA, NA, 335L, NA, NA, NA, NA, NA, NA), `45` = c(NA, 
      NA, NA, NA, 53L, NA, NA, NA, NA, NA), `46` = c(NA, NA, NA, 
      NA, NA, 33L, NA, NA, NA, NA), `47` = c(NA, NA, NA, NA, NA, 
      NA, 42L, NA, NA, NA), `48` = c(NA, NA, NA, NA, NA, NA, NA, 
      24L, NA, NA), `49` = c(NA, NA, NA, NA, NA, NA, NA, NA, 35L, 
      NA), `50` = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, 55L), `51` = c(12L, 
      NA, NA, NA, NA, NA, NA, NA, NA, NA), `52` = c(NA, 143L, NA, 
      NA, NA, NA, NA, NA, NA, NA), `53` = c(NA, NA, 533L, NA, NA, 
      NA, NA, NA, NA, NA), `54` = c(NA, NA, NA, 344L, NA, NA, NA, 
      NA, NA, NA), `55` = c(NA, NA, NA, NA, 232L, NA, NA, NA, NA, 
      NA), `56` = c(NA, NA, NA, NA, NA, 5332L, NA, NA, NA, NA), 
      `57` = c(NA, NA, NA, NA, NA, NA, 23L, NA, NA, NA), `58` = c(NA, 
      NA, NA, NA, NA, NA, NA, 333L, NA, NA), `59` = c(NA, NA, NA, 
      NA, NA, NA, NA, NA, 56L, NA), `60` = c(NA, NA, NA, NA, NA, 
      NA, NA, NA, NA, 75L)), row.names = c(NA, -10L), class = c(&quot;tbl_df&quot;, 
  &quot;tbl&quot;, &quot;data.frame&quot;))
  </code></pre>
  <p>And this is the desired output:</p>
  <pre><code>output &lt;- structure(list(X = 1:10, `1` = c(123L, 434L, 545L, 2323L, 54L, 
  23L, 54L, 24L, 53L, 44L), `2` = c(132L, 44L, 543L, 335L, 53L, 
  33L, 42L, 24L, 35L, 55L), `3` = c(12L, 143L, 533L, 344L, 232L, 
  5332L, 23L, 333L, 56L, 75L), `4` = c(123L, 434L, 545L, 2323L, 
  54L, 23L, 54L, 24L, 53L, 44L), `5` = c(132L, 44L, 543L, 335L, 
  53L, 33L, 42L, 24L, 35L, 55L), `6` = c(12L, 143L, 533L, 344L, 
  232L, 5332L, 23L, 333L, 56L, 75L), `7` = c(123L, 434L, 545L, 2323L, 
  54L, 23L, 54L, 24L, 53L, 44L), `8`= c(132L, 44L, 543L, 335L, 
  53L, 33L, 42L, 24L, 35L, 55L), `9` = c(12L, 143L, 533L, 344L, 
  232L, 5332L, 23L, 333L, 56L, 75L), `10` = c(123L, 434L, 545L, 
  2323L, 54L, 23L, 54L, 24L, 53L, 44L), `11` = c(132L, 44L, 543L, 
  335L, 53L, 33L, 42L, 24L, 35L, 55L), `12` = c(12L, 143L, 533L, 
  344L, 232L, 5332L, 23L, 333L, 56L, 75L)), class = &quot;data.frame&quot;, row.names = c(NA, 
  -10L))
  </code></pre>