title: Pivot wider returning 1 column?
body: <p>I'm trying to format my <code>base_df</code> to show <code>users_id</code> organized by program watched.</p>
  <p><strong>base_df</strong>:</p>
  <p><a href="https://i.stack.imgur.com/uGHCn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uGHCn.png" alt="enter image description here" /></a></p>
  <pre><code>base_df &lt;- structure(list(category = c(&quot;News&quot;, &quot;News&quot;, &quot;Sports&quot;, &quot;Sports&quot;, 
  &quot;sports&quot;, &quot;Sports&quot;, &quot;Sports&quot;, &quot;sports&quot;), programs = c(&quot;News A&quot;, 
  &quot;News B&quot;, &quot;Sports A&quot;, &quot;Sports B&quot;, &quot;sports C&quot;, &quot;Sports A&quot;, &quot;Sports B&quot;, 
  &quot;sports C&quot;), users_id = c(10003831, 10003823, 10003841, 10003823, 
  10003851, 10003851, 10003851, 10003854)), row.names = c(NA, -8L
  ), class = c(&quot;tbl_df&quot;, &quot;tbl&quot;, &quot;data.frame&quot;))
  </code></pre>
  <p><strong>Desired output:</strong></p>
  <p><a href="https://i.stack.imgur.com/cnso4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cnso4.png" alt="enter image description here" /></a></p>
  <p>I think <code>pivot_longer</code> can help me here:</p>
  <p>I've tried to use it but it returns a df with just the users_ids. What am I doing wrong?</p>
  <pre><code>b &lt;- pivot_wider(
    base_df,
    id_cols = users_id,
    names_from = programs
  )
  </code></pre>
  <p><a href="https://i.stack.imgur.com/HBJie.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HBJie.png" alt="enter image description here" /></a></p>