I am trying to print an R map with the following function (see at bottom) The input is a data frame that contain Longitude, Latitudes in decimal format and the errors that would be depicted as color bullet points.
This works quite okay but I want to add a new extra point, apart of what the data frame includes, that would have a different type (instead of dot, perhaps a cross or a square) and with a fixed red color, instead of following the color ramp I have for the rest of the points.
Can you please help me sort this out? Regard Alex
dfE<-data.frame(c(-0.1456250,-0.1442639),c(51.51476,51.51492),c(0.018878676,0.111847050))
names(dfE) <- c("Longitude", "Latitude", "Error")
stationaryPoint<-data.frame(0.1422361,51.51516)
names(stationaryPoint) <- c("Longitude", "Latitude")
data<-dfE
jet.colors <- colorRampPalette(c("#00007F", "red", "#007FFF", "yellow", "#7FFF7F", "cyan", "#FF7F00", "blue", "#7F0000"))
bbox <- c(min(data[, 1])-0.001, min(data[, 2])-0.001, max(data[, 1])+0.001, max(data[, 2])+0.001)
mp <- get_stamenmap(bbox, maptype = "toner", zoom = zoom)
ggmap(mp, darken = 0) + geom_point(aes(Longitude, Latitude, colour =Error), data = dfE, size = 3)
I tried adding the below line to add the extra point with different color and shape to the ggmap line before but I always get an error
- geom_point(aes(Longitude, Latitude), data = stationaryPoint, size = 3,shape=4,color="red")