r - Overlay map using ggplot2 -


I am using ggplot2 to plot the matrix, and then I use geom_text to add some letters to each point I am using Now, I was thinking that this is possible and how to overlay the map, because the prices represent the European region. This is my endeavor:

  Library (ggplot2) mat1 & lt; - Melt (vals [, TLT]) # Matrix [Long, Predatory] Matt 2 & lt; - Melt (name [, TLL] # matrix [long, fetch] p & lt; -JipLot (matte 1, aes (lawn, lit, fill = val)) + gom_straster () + gom_text (label = I get the image that I get with this code:   

Red ", na.value =" white ") P>

I would like to know whether it is possible to define areas with ggplot2 equals Adding a map to see any topic about this ???

Thank you in advance I will try to make a reputable sample (since the original data is very large). This structure will be the same Except that there is some NA in the original matrix.

  Library (GG Plot 2) takes #correnates & lt; - seq (= 72, = 34, = -1) Loni & lt ; - seq (= -13, = 34 for, = 1) m1 and lt; - array (runiff (length) * length (fetched)), in = C (length (Lonnie), length (Lati))) M-2 and LT; - Array (C ("A", "B"), dim = C (Length, Length (Length))) TLT & Lt; -c (Length: 1) #reverse latitude mat1 & lt; -melt (m1 [, t.lat]) # matrix [long, implant] matte 2 & lt; - Melt (M2 [, TLT]) Name (matte 1) & lt; - c ("lon", "late", "val") name (matte 2) & lt; - c ("lon", "lat", "val") p & lt; -ggplot (mat1, AES (loan, axis, fill = val)) + geom_raster () = Geom_text (label = mat2 $ val, na.rm = true, size = 3) + scale_fill_gradient (low = "white", high = "Red", na.value = "white")  

Then, I would like to overlay the area defined by coordinates, Loney and Laathi, which would be like adding a map in the background. I hope the question with the example is clear now.

Thanks again


Comments

Popular posts from this blog

ios - Form Sheet content disappearing -

MySql variables and php -

php - Laravel - Overriding a resource route into a different route filter group -