library(janeaustenr)
library(tidytext)
library(tidyverse)
library(tm)
library(corpus)
text <- removeNumbers(sensesensibility)
text <- data.frame(text)
tidy_text <- text %>% unnest_tokens(bigram,text,token='ngrams',n=2)
tidy_text %>%count(bigram,sort =TRUE)
tidy_text <-tidy_text %>% separate(bigram,c('word1','word2'),sep =' ')
tidy_text_filtered <- tidy_text %>%
filter(!word1 %in% stop_words$word)%>%
filter(!word2 %in% stop_words$word)
trigram_count <- tidy_text_filtered%>% count(word1,word2, sort= TRUE)
united <- trigram_count%>%unite(bigram,word1,word2,sep=' ')%>%
filter(n >1)
united <- united %>% bind_tf_idf(bigram,n)
However i am getting this error : "Error in tapply(n, documents, sum) : arguments must have same length"
What could be wrong in my usage of bind_tf_df