Skip to content

Error: Discrete value supplied to continuous scale #31

@IssamHu

Description

@IssamHu

Dear Sir,
I used the following cods:
`library("ggplot2")

library("ggmap")

library("scatterpie")

ap <- c(left = 36, bottom = 15, right = 60.4, top = 32)

myMap <- get_map(location=ap, source="stamen",
maptype="terrain", zoom = 9 ,crop=FALSE)

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)`

for the 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

but I get this error:
Error: Discrete value supplied to continuous scale

Please can you help me to solve this issue.

Thanks,
IssamHu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions