r - Can't plot a scale bar or north arrow on ggplot2 -


Help! I have a data set of GPS X / Y locations for trees in the forest, and with this code in a beautiful map in ggplot:

  #ggmap! Library (GGMAP) Library (Maprop) Map & amp; Lt; - get_map (location = 'madagascar', zoom = 10) geodode ("kayajwat") # lawn latitude # 47.86682 -21.38024 C & lt; - "Keyzayvato" Marimop & lt; - get_map location = k, source = "stemon", mappetpe = "toner", crop = falls, zoom = 16) ggmap (myMap) m   

However, what type of code do I try, I can not try any type of arrow to point to the answer or scale bar on my map!

  map.scale & lt; - ggmap (new) + (GGMAP, +) Yes = "normal", mapper = FALSE)% +% sites.data + geom_point (aes (x = lon, y = latitude, color = color)) + geom_text (aes X = lon, y = lat, label = label), hjust = 0, vjust = 0.5, size = 8 / ptspermm) + geom_segment (data = sbar, aes (x = lon.start, xend = lon.end, y = Lat.start, yend = lat.end)) + geom_text (data = sbar, aes (x = (lon.start + lon.end) / 2, y = lat.start + 0.025 * (BB $ ur.lat - bb $ Ll.lat), label = paste (format (distance, digits = 4, NSL = 2), 'km'), hjust = 0.5, vjust = 0, size = 8 / ptspermm + coordinate_map (projection = "Mercator ", xlim = c (bb $ ll.lon, bb $ ur.lon), ylim = c (bb $ ll.lat, bb $ ur.lat)) # Library (SDM tools) # The argument "len" is unavailable in cluster (x = 47.868, y = -21.375, distance = 100, unit = 'm') in #show values ​​in meter # error map.scale (x = 50, y = -22) Without a default map.scale (x = 47.868, y = -21.375, ratio = FALSE, Relwidth = 0.2) # error in map.scale (x = 47 .868, y = -21.375, ratio = FALSE, relwidth = 0.2) : Unused argument (s) (ratio = FALSE, relwidth = 0.2) map.scale (x = 47.868, y = -21.375) # Error in map.scale (x = 47.868, y = -21.375): no default  "LAN" is missing the argument with  

, I need both north arrow and scale, nor plot it Security! Why?

ggsn package is useful here. Without GPS data, I can not execute all your scripts, but it should add the answer symbol and scale bar in the appropriate places according to specified symbols and specified boundaries.

  # First, add a scale bar n & lt; - n + scalebar (location = "bottom", y.min = -21.3755, y.max = -21.3715, x.min = 47.865, x.max = 47.869, dist = .1, dd2km = TRUE, model = 'WGS84 ', st.dist = .04) # Now add a North arrow and plot the map. Answer 2 (n, x = .3, y = .8, symbol = 9)   



Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -