Incompatible methods ("Ops.raster", "+.gg") for "+" and non-numeric argument to binary operator

Hello !
I hope that I achieve to use Reprex ! Thank you a lot in advance and I'm sorry if reprex doesn't work.
So my error message here is..

Error in eastern_map + geom_point(data = df, aes(x = LONGITUDE, y = LATITUDE, :
non-numeric argument to binary operator
In addition: Warning message:
Incompatible methods ("Ops.raster", "+.gg") for "+"

library(ggplot2)
df <- data.frame(stringsAsFactors=FALSE, INTER1 = c(1, 2, 3, 4, 7, 8), LATITUDE = x, LONGITUDE = y)

eastern_map +
geom_point(data = df, aes(x = LONGITUDE, y = LATITUDE, color = INTER1), size=1, alpha=0.5) +
theme(legend.position = "bottom")

A tibble: 8 x 3

INTER1 LATITUDE LONGITUDE

1 2 8.11 -11.6
2 2 8.11 -11.6
3 2 7.96 -11.7
4 2 7.96 -11.7
5 2 7.96 -11.7
6 2 7.96 -11.7
7 4 7.62 -11.8
8 1 7.61 -11.8

reprex::reprex(library(ggplot2)
df <- data.frame(stringsAsFactors=FALSE, INTER1 = c(1, 2, 3, 4, 7, 8), LATITUDE = x, LONGITUDE = y)

           eastern_map +
             geom_point(data = df, aes(x = LONGITUDE, y = LATITUDE, color = INTER1), size=1, alpha=0.5) +
             theme(legend.position = "bottom") 
           
           
           # A tibble: 8 x 3
           INTER1 LATITUDE LONGITUDE
           <dbl>    <dbl>     <dbl>
             1      2     8.11     -11.6
           2      2     8.11     -11.6
           3      2     7.96     -11.7
           4      2     7.96     -11.7
           5      2     7.96     -11.7
           6      2     7.96     -11.7
           7      4     7.62     -11.8
           8      1     7.61     -11.8)

We don't have enough info to help you out since you are not showing what is or from where are you getting eastern_map.

For posterity, here is link to your same question on Stack Overflow: https://stackoverflow.com/questions/56795144/incompatible-methods-ops-raster-gg-for-and-non-numeric-argument-to

It's OK to cross-post on this forum but we do ask that you link to your other posts. :slightly_smiling_face: FAQ: Is it OK if I cross-post?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.