0

unnest_tokens() was deprecated in tidytext 0.4.0 and is now defunct

Attempting to create a 2-node graph through twitter data within R and am receiving the following error message.

twomode_network <- twitter_data %>% Create("twomode", removeTermsOrHashtags = c("#auspol"), verbose = TRUE)
twomode_graph <- twomode_network %>% Graph()

Generating twitter 2-mode network...
Error:
! `unnest_tokens()` was deprecated in tidytext 0.4.0 and is now defunct.
Run `rlang::last_trace()` to see where the error occurred.

TheDud
  • 1
  • 1

1 Answers1

0

Thanks for reporting this! I fixed this (confusing) message on GitHub here and now you correctly see this:

library(tidytext)

d <- tibble::tibble(
  txt = c("Because I could not stop for Death -", "He kindly stopped for me -"),
  line = 1:2
)

d |> unnest_tweets(word, txt)
#> Error:
#> ! `unnest_tweets()` was deprecated in tidytext 0.4.0 and is now defunct.

Created on 2023-06-01 with reprex v2.0.2

As before you will see this error when using unnest_tokens() with token = "tweets":

library(tidytext)

d <- tibble::tibble(
  txt = c("Because I could not stop for Death -", "He kindly stopped for me -"),
  line = 1:2
)

d |> unnest_tokens(word, txt, token = "tweets")
#> Error:
#> ! Support for `token = "tweets"` was deprecated in tidytext 0.4.0 and is
#>   now defunct.

Created on 2023-06-01 with reprex v2.0.2

The tweet-specific tokenizer was removed because of changes in upstream dependencies; you can see this in the documentation here.

Julia Silge
  • 10,848
  • 2
  • 40
  • 48