dkahle / ggmap

A package for plotting maps in R with ggplot2
763 stars 231 forks source link

Error: Discrete value supplied to continuous scale #319

Open IssamHu opened 3 years ago

IssamHu commented 3 years ago

Hi,

I've this error when I run this cods: Error: Discrete value supplied to continuous scale

ggmap(myMap) +
  scale_fill_etopo()  +  
  coord_cartesian(expand = 0) + 
  labs(y = "Latitude", x = "Longitude") +
  theme(legend.position = "none") + 
  geom_scatterpie(aes(x=Longitude, y=Latitude, group=Country), data=Piedata,
                  cols=c("Legal", "Illegal"), pie_scale = 1, 
                  sorted_by_radius = FALSE, legend_name = "type",
                  long_format=FALSE)

My data: Piedata Country Legal Illegal Latitude Longitude 1 A 0.375 0.625 29.74247 48.41323 2 B 0.852 0.148 27.77500 49.14698 3 C 0.345 0.655 26.31520 50.49300 4 D 0.562 0.439 25.56074 51.64831 5 E 0.410 0.590 25.45679 54.72089 6 F 0.750 0.250 21.11154 59.32937

How can I solve this error Thanks

besibo commented 3 years ago

@IssamHu Please, see my answer here It's usually not a great idea to post he same question in several places, especially when the error message you're facing has nothing to do with the package maintainer(s) you're asking your question to. You sent your question to the maintainers of ggmap, scatterpie and marmap, when you should have just googled your error message to get basically the same answer I gave you on the marmap repo issue page...