0

I have two columns - one with week days and one with three values (positive, negative and neutral).

plot( overall_sentiment~ comments_created_at, data = Meteor)

I want a plot with weekdays on the x-axis and bars with the count of positive, count of negative and count of neutral.

James Martherus
  • 1,033
  • 1
  • 9
  • 20
awais khan
  • 69
  • 4
  • Post some sample data and then we can give you some sample code! – Gregor Thomas Aug 22 '19 at 03:35
  • [See here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) on making an R question that folks can help with. That includes a sample of data, all necessary code, and a clear explanation of what you're trying to do and what hasn't worked. You've tagged `ggplot2`, but are using base R `plot`—which are you trying to do? – camille Aug 22 '19 at 03:55

1 Answers1

1

You want something like this:

library(dplyr)
library(ggplot2)

Meteor %>%
  group_by(weekday) %>%
  summarise(n = n()) %>%
  ggplot() + aes(x=weekday, y=n) +
  geom_col()
James Martherus
  • 1,033
  • 1
  • 9
  • 20