I'm trying to create a figure in R that has a base worldmap with locations overlaid on top as points. I'd also like to specify the size and color of the points with additional data from my dataframe. Here is my code as it stands:
#reading in data
world <-map_data("world")
data <-read.csv("map_data.csv", header=TRUE)
#creating base worldmap
worldbase <- ggplot()+
geom_polygon(data=world, aes(x=long, y=lat, group=group), fill=NA, color="black") +
coord_fixed(1.3)
#overlaying points on top of base map
worldbase +
geom_point(data=data, mapping=aes(x=Long_DD, y=Lat_DD, size=total_bases, color=factor(seq_type))) #These are all columns in my dataframe containing longitude, latitude, continuous information (total_bases) and categorical information (seq_type).
Currently, I'm getting the error message
"Error: Discrete value supplied to continuous scale"
I know this has to do with my x and y specifications, but how else would I plot the lat and long values from my dataframe?