Closed arencambre closed 5 years ago
This code in section 9.1 cannot work:
raw_text <- tibble(folder = dir(training_folder, full.names = TRUE)) %>% unnest(map(folder, read_folder)) %>% transmute(newsgroup = basename(folder), id, text)
unnest expects a data frame for its data argument (source), and map returns a list (source).
Anyone using the code will get this error: Error: map(.$folder, read_folder) must evaluate to column positions or names, not a list.
map(.$folder, read_folder)
Also, unnest requires specification of the cols argument, and that is not specified in the code.
Thank you so much for the report @arencambre! 🙌 This code I just pushed should fix the issue.
Ah, breaking change in tidyr! I was wondering what the root cause was. 😁
This code in section 9.1 cannot work:
unnest expects a data frame for its data argument (source), and map returns a list (source).
Anyone using the code will get this error: Error:
map(.$folder, read_folder)
must evaluate to column positions or names, not a list.Also, unnest requires specification of the cols argument, and that is not specified in the code.