require(quanteda)
require(readtext)
data_twitter <- readtext("/home/kohei/packages/quanteda.tutorials/content/data/twitter.json",
source = "twitter")
corp_tweets <- corpus(data_twitter)
dfmat_tweets <- dfm(corp_tweets,
remove_punct = TRUE, remove_url = TRUE,
remove = c('*.tt', '*.uk', '*.com', 'rt', '#*', '@*')) %>%
dfm_remove(stopwords('en'))
dfmat_users <- dfm_group(dfmat_tweets, groups = 'screen_name')
sum(rowSums(dfmat_users_prop) == 0)
# [1] 200
dfmat_users_prop <- dfmat_users %>%
dfm_select(min_nchar = 2) %>%
dfm_trim(min_termfreq = 10) %>%
dfm_weight('prop')
textstat_dist(dfmat_users_prop)
# Error in rep_len(value, lenRepl) : attempt to replicate non-vector
Because of this bug, we cannot build quanteda.tutorials.io
Because of this bug, we cannot build quanteda.tutorials.io