I am trying to count the tokenized sentences consisting of 3-4 words. However I am getting error as
Error in UseMethod("pull") : no applicable method for 'pull' applied to an object of class "character"
I extracted the data from Excel file which consists of sentences like :
1.I am happy person today
2.I am sad today.
3. I am happy person.
4.I am sad person.
5.I am happy and beautiful
the answer should give me result such as :
I am happy 3
I am sad 2
library(tokenizers) library(stopwords) new <- feed$Feedback new<-gsub("NA","",as.character(new)) new<- gsub("Blank","",as.character(new)) new<- gsub('blank',"",as.character(new)) tft_token_ngram <- tokenize_ngrams(x = new, lowercase = TRUE, n = 4L, n_min = 3L, stopwords = character(), ngram_delim = " ", simplify = FALSE) a <- tft_token_ngram %>% count(word,sort = TRUE)