I need to tokenize the text data as code below, but generate error. How to fix it? Thanks!
library(readr)
europeecondata <- read_csv("C:/Users/lin/Documents/europeecondata.csv")
european_text <- data_frame(line=1:273, text=europeecondata$text)
european_text$text <- gsub("http[^[:space:]]*","", european_text$text) # For http
european_text$text <- gsub("http[^[:space:]]*","", european_text$text) # For https
data(stop_words)
euro_tokens <- european_text$text %>%
unnest_tokens(word, text) %>%
anti_join(stop_words)%>%
count(word, sort=T)
Output: Error in UseMethod("unnest_tokens_") : no applicable method for 'unnest_tokens_' applied to an object of class "character"