我无法使用所有这些软件包的当前 CRAN 版本重现这些错误。
library(dplyr)
library(janeaustenr)
library(tidytext)
d <- data_frame(txt = prideprejudice)
d %>% unnest_tokens(word, txt, token = "words")
#> # A tibble: 122,204 x 1
#> word
#> <chr>
#> 1 pride
#> 2 and
#> 3 prejudice
#> 4 by
#> 5 jane
#> 6 austen
#> 7 chapter
#> 8 1
#> 9 it
#> 10 is
#> # ... with 122,194 more rows
d %>% unnest_tokens(sentence, txt, token = "sentences")
#> # A tibble: 7,066 x 1
#> sentence
#> <chr>
#> 1 pride and prejudice by jane austen chapter 1 it is a truth unive…
#> 2 however little known the feelings or views of such a man may be on his…
#> 3 "\"my dear mr."
#> 4 "bennet,\" said his lady to him one day, \"have you heard that netherf…
#> 5 mr.
#> 6 bennet replied that he had not.
#> 7 "\"but it is,\" returned she; \"for mrs."
#> 8 "long has just been here, and she told me all about it.\""
#> 9 mr.
#> 10 bennet made no answer.
#> # ... with 7,056 more rows
d %>% unnest_tokens(ngram, txt, token = "ngrams", n = 2)
#> # A tibble: 122,203 x 1
#> ngram
#> <chr>
#> 1 pride and
#> 2 and prejudice
#> 3 prejudice by
#> 4 by jane
#> 5 jane austen
#> 6 austen chapter
#> 7 chapter 1
#> 8 1 it
#> 9 it is
#> 10 is a
#> # ... with 122,193 more rows
由reprex 包(v0.2.0) 于 2018 年 5 月 8 日创建。
也许您应该尝试从 CRAN 重新安装这些软件包?