title: Error: Must extract column with a single valid subscript. x Subscript `var` has size 268 but must be size 1. Code and dataframe include
body: <p>So I have this dataset</p>
  <pre class="lang-r prettyprint-override"><code># A tibble: 268 x 1
   Which_of_these_social_media_platforms_do_you_have_an_account_in_right_now?
     &lt;chr&gt;                                                                       
   1 Facebook, Instagram, Twitter, Snapchat, Reddit, Signal                      
   2 Reddit                                                                      
   3 Facebook, Instagram, Twitter, Linkedin, Snapchat, Reddit, Quora             
   4 Facebook, Instagram, Twitter, Snapchat                                      
   5 Facebook, Instagram, TikTok, Snapchat                                       
   6 Facebook, Instagram, Twitter, Linkedin, Snapchat                            
   7 Facebook, Instagram, TikTok, Linkedin, Snapchat, Reddit                     
   8 Facebook, Instagram, Snapchat                                               
   9 Linkedin, Reddit                                                            
  10 Facebook, Instagram, Twitter, TikTok                                        
  # ... with 258 more rows
  </code></pre>
  <p>and I want to break this into multiple columns with yes and no on each variable like this</p>
  <pre><code># A tibble: 268 x 8
        Id Facebook Instagram Reddit Signal Snapchat TikTok Twitter
     &lt;int&gt; &lt;chr&gt;    &lt;chr&gt;     &lt;chr&gt;  &lt;chr&gt;  &lt;chr&gt;    &lt;chr&gt;  &lt;chr&gt;  
   1     1 No       No        No     No     No       No     Yes    
   2     2 Yes      Yes       No     No     Yes      No     Yes    
   3     3 No       Yes       No     Yes    No       Yes    No     
   4     4 No       Yes       No     No     Yes      No     No     
   5     5 No       Yes       No     Yes    Yes      Yes    Yes    
   6     6 No       Yes       No     No     No       No     No     
   7     7 No       No        Yes    Yes    No       Yes    Yes    
   8     8 No       No        Yes    No     No       No     Yes    
   9     9 No       No        Yes    No     Yes      Yes    No     
  10    10 No       Yes       Yes    Yes    Yes      No     Yes
  </code></pre>
  <p>So I wrote this code to do so</p>
  <pre><code>library(tidyverse)
  library(tidytext)
  
  Survey %&gt;%
    mutate(Id = row_number(), HasAccount = &quot;Yes&quot;) %&gt;%
    unnest_tokens(Network, `Which of these social media platforms do you have an account in right now?`, to_lower = F) %&gt;%
    spread(Network, HasAccount, fill = &quot;No&quot;)
  </code></pre>
  <p>but I get this error</p>
  <pre><code>Erreur : Must extract column with a single valid subscript.
  x Subscript `var` has size 268 but must be size 1.
  </code></pre>
  <p>Here is a summary of the df used</p>
  <pre><code>&gt; dput(head(Survey[1:5]))
  structure(list(Horodateur = structure(c(1619171956.596, 1619172695.039, 
  1619173104.83, 1619174548.534, 1619174557.538, 1619174735.457
  ), tzone = &quot;UTC&quot;, class = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;)), `To_which_gender_you_identify_the_most?` = c(&quot;Male&quot;, 
  &quot;Female&quot;, &quot;Male&quot;, &quot;Female&quot;, &quot;Female&quot;, &quot;Female&quot;), What_is_your_age_group = c(&quot;[18-24[&quot;, 
  &quot;[10,18[&quot;, &quot;[18-24[&quot;, &quot;[18-24[&quot;, &quot;[18-24[&quot;, &quot;[25,34[&quot;), How_much_time_do_you_spend_on_social_media = c(&quot;1-5 hours&quot;, 
  &quot;1-5 hours&quot;, &quot;&gt;10 hours&quot;, &quot;5-10 hours&quot;, &quot;5-10 hours&quot;, &quot;1-5 hours&quot;
  ), `Which_of_these_social_media_platforms_do_you_have_an_account_in_right_now?` = c(&quot;Facebook, Instagram, Twitter, Snapchat, Reddit, Signal&quot;, 
  &quot;Reddit&quot;, &quot;Facebook, Instagram, Twitter, Linkedin, Snapchat, Reddit, Quora&quot;, 
  &quot;Facebook, Instagram, Twitter, Snapchat&quot;, &quot;Facebook, Instagram, TikTok, Snapchat&quot;, 
  &quot;Facebook, Instagram, Twitter, Linkedin, Snapchat&quot;)), row.names = c(NA, 
  -6L), class = c(&quot;tbl_df&quot;, &quot;tbl&quot;, &quot;data.frame&quot;))
  </code></pre>