Q: Error: Must extract column with a single valid subscript. x Subscript `var` has size 268 but must be size 1. Code and dataframe include So I have this dataset
# A tibble: 268 x 1
 Which_of_these_social_media_platforms_do_you_have_an_account_in_right_now?
   <chr>                                                                       
 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

and I want to break this into multiple columns with yes and no on each variable like this
# A tibble: 268 x 8
      Id Facebook Instagram Reddit Signal Snapchat TikTok Twitter
   <int> <chr>    <chr>     <chr>  <chr>  <chr>    <chr>  <chr>  
 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

So I wrote this code to do so
library(tidyverse)
library(tidytext)

Survey %>%
  mutate(Id = row_number(), HasAccount = "Yes") %>%
  unnest_tokens(Network, `Which of these social media platforms do you have an account in right now?`, to_lower = F) %>%
  spread(Network, HasAccount, fill = "No")

but I get this error
Erreur : Must extract column with a single valid subscript.
x Subscript `var` has size 268 but must be size 1.

Here is a summary of the df used
> dput(head(Survey[1:5]))
structure(list(Horodateur = structure(c(1619171956.596, 1619172695.039, 
1619173104.83, 1619174548.534, 1619174557.538, 1619174735.457
), tzone = "UTC", class = c("POSIXct", "POSIXt")), `To_which_gender_you_identify_the_most?` = c("Male", 
"Female", "Male", "Female", "Female", "Female"), What_is_your_age_group = c("[18-24[", 
"[10,18[", "[18-24[", "[18-24[", "[18-24[", "[25,34["), How_much_time_do_you_spend_on_social_media = c("1-5 hours", 
"1-5 hours", ">10 hours", "5-10 hours", "5-10 hours", "1-5 hours"
), `Which_of_these_social_media_platforms_do_you_have_an_account_in_right_now?` = c("Facebook, Instagram, Twitter, Snapchat, Reddit, Signal", 
"Reddit", "Facebook, Instagram, Twitter, Linkedin, Snapchat, Reddit, Quora", 
"Facebook, Instagram, Twitter, Snapchat", "Facebook, Instagram, TikTok, Snapchat", 
"Facebook, Instagram, Twitter, Linkedin, Snapchat")), row.names = c(NA, 
-6L), class = c("tbl_df", "tbl", "data.frame"))

