How to extract the hashtags from a tweet in R




I want to create a word cloud to visualize the most frequent hashtags.For this I want to extract the first hashtag of a tweet.How do I do it?
I have used:

hashtags$hashtag <-  str_extract(tweets.df$text,"#\\w+")

But this is not working,so can somebody please help me with the code for this?



You can use below code to extract information about hashtag.

ARG.list <- searchTwitter(‘#ARG #FIFA’, n=1000, cainfo=”cacert.pem”)
ARG.df = twListToDF(ARG.list)

For more detail on this, you can refer article “Who is the world cheering for? 2014 FIFA WC winner predicted using Twitter feed (in R)”.