将 Twitter 数据转换成整洁的格式
Converting Twitter data into a tidy format
我正在尝试使用以下格式和代码将推文转换为整洁的文本格式:
## Convert twitter into a tidy text format where the unit of analysis is the ##`tweet_id-handle-time_stamp-word`
tidy_format = trump_clinton_tweets %>% mutate(tweet_id = row_number()) %>%
tidy_format = tidy_format %>% group_by(tweet_id) %>% unnest_tokens(word, text, token = "tweets") %>%
glimpse(tidy_format)
而且我不断收到此错误:
"Error in check_input(x) :
Input must be a character vector of any length or a list of character
vectors, each of which has a length of 1"
打印正在清理的推文,你会知道是哪条推文产生了错误,很可能会有空字符串作为导致此错误的推文。
我正在尝试使用以下格式和代码将推文转换为整洁的文本格式:
## Convert twitter into a tidy text format where the unit of analysis is the ##`tweet_id-handle-time_stamp-word`
tidy_format = trump_clinton_tweets %>% mutate(tweet_id = row_number()) %>%
tidy_format = tidy_format %>% group_by(tweet_id) %>% unnest_tokens(word, text, token = "tweets") %>%
glimpse(tidy_format)
而且我不断收到此错误:
"Error in check_input(x) : Input must be a character vector of any length or a list of character vectors, each of which has a length of 1"
打印正在清理的推文,你会知道是哪条推文产生了错误,很可能会有空字符串作为导致此错误的推文。