New to tidytext and running into an error.
When I try to pass anything other than "words" into the token argument for the unnest_tokens function I get:
Error in eval(substitute(expr), envir, enclos) : object 'txt' not found
Cant even run the documentation examples...
library(dplyr)
library(janeaustenr)
library(tidytext)
d <- data_frame(txt = prideprejudice)
d %>% unnest_tokens(word, txt, token = "words") #Works
d %>% unnest_tokens(sentence, txt, token = "sentences") #doesnt work
d %>% unnest_tokens(ngram, txt, token = "ngrams", n = 2) #doesnt work
When I run it on my own code (not the example), i get:
Error in eval(substitute(expr), envir, enclos) : invalid argument type
Im hoping this is a 'facepalm' type of mistake :). Strange that I cant even run the help example though...
Thanks!