0

enter image description hereI am trying to analyze customer reviews. My data base is composed of one column named ReqSummary and when I am trying to start my sentiment analysis I receive the following error message: Error in check_input(x) : Input must be a character vector of any length or a list of character vectors, each of which has a length of 1. Here is my code:

library(tidyverse)
library(tidytext)
library(readr)

data.tb <- as_tibble(data.frame(data))
data.tok <- unnest_tokens(data.tb, output="word", input="ReqSummary", to_lower=TRUE, strip_punct=TRUE, strip_numeric=TRUE)
AnilGoyal
  • 25,297
  • 4
  • 27
  • 45
Narin
  • 21
  • 1
  • 3
  • 2
    please post your sample `data` a few rows at least – AnilGoyal May 03 '21 at 11:50
  • Hello Anil, I posted a picture of the the sample – Narin May 03 '21 at 12:06
  • Hi narin. Not as an image, but please paste it as code which is in [reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) format. Please see tag info more details – AnilGoyal May 03 '21 at 12:40

1 Answers1

0

I guess you need to call the variable by name using the $ operator:

data.tok <- unnest_tokens(data.tb$ReqSummary, output="word", input="ReqSummary", to_lower=TRUE, strip_punct=TRUE, strip_numeric=TRUE)
Chris Ruehlemann
  • 20,321
  • 4
  • 12
  • 34