Linked Questions

Popular Questions

How do I choose the colors of my data point?

Asked by At

I want to choose the colors of my data points instead of them being randomly assigned through R. Can someone please tell me how to change my if function to be able to do so? Specifically, I want 0 to be red, 1 to be blue, and 5 to be grey.

# get map #
usa <- map_data("usa")
state <- map_data("state")
m <- ggplot(data=state)+ geom_polygon(aes(x=long, y=lat, group=group), color="black", fill="black")
m <- m+ theme_bw()
m 

# Status #
Status <- ifelse(geolocation$Status==0, 0, ifelse (geolocation$Status==1, 1, 5))

# plot data on map #
m <- m+geom_point(data=geo, aes(x= Long, y= Lat, color= Status))
m

Related Questions