0

I have the following code which I am attempting to run to plot monthly counts against the month, for 4 different years to see trends in seasonal periods.

g <- ggplot(groups.byYearAndMonth,aes(y=number, x=month.Raised, group=year.Raised))
g <- geom_line()

I keep getting an error in the console stating:

Error in geom_point() + geom_line() : non-numeric argument to binary operator

The data has layout and format:

year.Raised  month.Raised  number
       2016           Nov       6

with the year as a numeric variable and the month and number as factors.

Marco Sandri
  • 23,289
  • 7
  • 54
  • 58
  • Please read [(1)](http://stackoverflow.com/help/how-to-ask) how do I ask a good question, [(2)](http://stackoverflow.com/help/mcve) How to create a MCVE as well as [(3)](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example#answer-5963610) how to provide a minimal reproducible example in R. Then edit and improve your question accordingly. I.e., abstract from your real problem... – Christoph Jul 24 '17 at 13:20

1 Answers1

2

The second line should be g<-g + geom_line().

Dan
  • 11,370
  • 4
  • 43
  • 68