Here in zomato folder there are 4 csv( bengoli, chinese, italian and panjabi)file. I am comparing these files with positive and negative word text file using lexicom based sentiment analysis.everything is working well , also i am getting values of a, c, e , g very perfectly. but when it comes to plot it is giving me this error
Don't know how to automatically pick scale for object of type list. Defaulting to continuous. Error: geom_bar requires the following missing aesthetics: y
library(stringr)
library(ggplot2)
library(tm)
src <- DirSource("./Data/foodwise/zomato")
docs <- Corpus(src)
docs <- tm_map(docs, removePunctuation)
docs <- tm_map(docs,content_transformer(tolower))
docs <- tm_map(docs, removeNumbers)
docs <- tm_map(docs, removeWords,stopwords("english"))
docs <- tm_map(docs, stripWhitespace)
docs <- tm_map(docs, stemDocument)
writeCorpus(docs, path="./Data")
texts <- readLines("./Data/zomato bengoli.csv.txt")
opinion.lexicon.pos <- scan('./Data/positive-word.txt', what='character', comment.char = ';')
opinion.lexicon.neg <- scan('./Data/negative-word.txt', what='character', comment.char = ';')
jj <- str_split(texts, pattern="\\s+")
a <- lapply(jj,function(x){sum(!is.na(match(x,opinion.lexicon.pos)))})
texts1 <- readLines("./Data/zomato chinese.csv.txt")
jj <- str_split(texts1, pattern="\\s+")
c <- lapply(jj,function(x){sum(!is.na(match(x,opinion.lexicon.pos)))})
texts2 <- readLines("./Data/zomato Italian.csv.txt")
jj <- str_split(texts2, pattern="\\s+")
e <- lapply(jj,function(x){sum(!is.na(match(x,opinion.lexicon.pos)))})
texts3 <- readLines("./Data/zomato panjabi.csv.txt")
jj <- str_split(texts3, pattern="\\s+")
g <- lapply(jj,function(x){sum(!is.na(match(x,opinion.lexicon.pos)))})
x <-c("Bengoli", "Chinese", "Italian", "Panjabi")
y <- c(a, c ,e, g)
data <- data.frame(x, y)
ggplot(data, aes(x, y)) + geom_bar(stat = "identity",aes(fill = x)) + xlab("Cuisines") + ylab("Total count") + ggtitle("")+ scale_fill_manual("Cuisines", values = c("Italian" = "lightpink", "Panjabi" = "lightblue", "Chinese" = "darkgrey", "Bengoli"="lightgreen"))