Skip to content

Instantly share code, notes, and snippets.

@kleinlennart
Created November 12, 2020 20:33
Show Gist options
  • Save kleinlennart/5c144d4384bdfc54138bb4b32989e669 to your computer and use it in GitHub Desktop.
Save kleinlennart/5c144d4384bdfc54138bb4b32989e669 to your computer and use it in GitHub Desktop.
Extract hashtags from tweets
# clean Hashtag extraction method
## evtl. noch Umlaute entfernen!
add_hashtags <- function(dat) {
return(
dat %>%
mutate(
hashtags = text %>% tolower() %>% str_extract_all("#[[:alnum:]_]+")
)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment