http://tidytextmining.com/twitter.htmlにあるサンプルを再現しようとすると問題が発生します。tidytextパイプによるフィルタエラーの例
基本的に私はつぶやきのデータフレームを含まSTOP_WORDを維持するために、コード
library(tidytext)
library(stringr)
reg <- "([^A-Za-z_\\d#@']|'(?![A-Za-z_\\d#@]))"
tidy_tweets <- tweets %>%
mutate(text = str_replace_all(text, "https://t.co/[A-Za-z\\d]+|http://[A-Za-z\\d]+|&|<|>|RT", "")) %>%
unnest_tokens(word, text, token = "regex", pattern = reg) %>%
filter(!word %in% stop_words$word,
str_detect(word, "[a-z]"))
のこの部分を適応したいです。 、私は両方の入力のベクトルのバージョンが一致して合格しようとしてい
Error in match(x, table, nomatch = 0L) :
'match' requires vector arguments
:
は、だから私はこの試みた:
tidy_tweets <- tweets %>%
mutate(text = str_replace_all(text, "https://t.co/[A-Za-z\\d]+|http://[A-Za-z\\d]+|&|<|>|RT", "")) %>%
unnest_tokens(word, text, token = "regex", pattern = reg)
tidy_tweets_sw <- filter(!word %in% stop_words$word, str_detect(tidy_tweets, "[a-z]"))
をしかし、私は、次のエラーメッセージが表示されましたとして、それは動作しませんでしたしかし役に立たない。 誰かが良いアイデアを持っていますか?
tidytextは通常、 'を使用していますanti_join(stop_words) 'を入力します。 – alistaire