Plotting points from a data.frame using OpenStreetMap
I am a complete novice with spacial data. I have the following code that successfully plots a bounded map. I would like to add, as points the data.frame stores.
I apologize in advance for not being able to figure this out from the OpenStreetMap documentation...code below:
library(OpenStreetMap) stores <- data.frame(name=c("Commercial","Union","Bedford"), longitude=c(-70.25042295455933,-70.26050806045532,-70.27726650238037), latitude=c(43.657471302616806,43.65663299041943,43.66091757424481)) lat <- c(43.68093,43.64278) lon <- c(-70.29548,-70.24097) portland <- openmap(c(lat[1],lon[1]),c(lat[2],lon[2]),zoom=15,'osm') plot(portland,raster=TRUE) #can't figure out what to put here.
I suspect the format of stores isn't proper for spatial data.
Thanks in advance,
--JT
