FRI_v2
进阶版的friend文字云,对我的审美感到担忧...
此次我删掉一些useless的words,然后发现在朋友的posts里,overthinking,inaproporate等负面词汇也有被提到。
图片依次往下的形状是:星星(我小名(///▽///)),FRI字母,扇子,北京天坛,Twitter的logo...
最后一个是拿wordcloud2的自带example做的练习...
但是emem,从北京天坛的那张图看,还是有很多meaningless的words,哎,感觉这个主题不适合这张图...
今天的练习遇到了一个time-consuming的bug...我之后大概会写一个bug集合,about how to deal with them and save your time.
code放在下面了,唔,是关于扇子的那个图,主要电脑卡的不行,累了。
到此吧,先来个午觉。
#
get_token()
#
fri <- search_tweets("#friendship", n=2000, include_rts=FALSE)
head(fri,3)
dim(fri)
fri$text
#
friTable <- fri %>%
unnest_tokens(word, text)
#
data(stop_words)
friTable <- friTable %>%
anti_join(stop_words)
#
friTable <- friTable %>%
count(word, sort = TRUE)
#
friTable <- friTable %>%
filter(!word %in% c("followme", "follow4follow",
"retweet", "followback",
"friend", "amp", "feel", "it's",
"friendship","shanaluxshana",
"https","losliya", "t.co",
"friends","day",
"alphian536874", "people",
"_priya_manan_", "don’t"))
wordcloud2(friTable, size=0.7)
#
url = "https://wx4.sinaimg.cn/mw690/0066XRzygy1gexnugsqkzj302o02ot8h.jpg"
fly <- "0066XRzygy1gexi1aapm4j30jg0jgq32.jpg"
download.file(url, fly)
#
wordcloud2(friTable, figPath =fly,size =1.5)
评论