I have a data frame with some tweets and i want to extract the hashtags from the tweets using the unnest_tokens() function of tidytext package , creating a tokenized data frame with one row per hashtag.
My data only have 3 columns:
- Fecha: that is a the dates od the tweets in a POSIXct variable type.
- Usuario: that is the id user of the tweets in a Numeric varible type.
- Texto: that is the text the tweeets in a character variable type.
otros_numerales_numeral_petro <- Numeral_Petro_sin_emojis %>%
unnest_tokens(output = "hashtag", input = "Texto", token = "tweets") %>%
filter(str_starts(hashtag, "#"))
But, when i run the code i got this error:
Error: ! Support for
token = "tweets"was deprecated in tidytext 0.4.0 and is now defunct.
Can someone help me to fix this, please.

Yep, the
token = "tweets"option was deprecated at the end of last year because of changes in upstream dependencies. It sounds you don't want to tokenize the text really, but rather extract all the hashtags. I would do this:Created on 2023-04-01 with reprex v2.0.2