Error: stat_count() must not be used with a y aesthetic.ggplot(ah, aes(x=Var1, y=Freq)) + geom_bar(stat = "identity")add stat=identity Error in -freq : invalid argument to unary operatormultiline problem if case of not working well, use aes method to the inside of ggplot() method