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.

1
  • Please read (1) how do I ask a good question, (2) How to create a MCVE as well as (3) how to provide a minimal reproducible example in R. Then edit and improve your question accordingly. I.e., abstract from your real problem... Commented Jul 24, 2017 at 13:20

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.