I'm a novice user in R.

I have a dataset consisted of coordinates of some "kind of centroids" of grid cells and my question is if any formula exists to create representative sized grid cells using the size parameter of geom_point, knowing the size of my cell in degrees.

Here is an example of my code:

x <- ggmap(map) +
      geom_point(data = df, 
                aes(colour= zscore), shape=15,alpha=0.8,

                size = varsize)

For example, in case I know the cell grids are 0.05 in degrees, which size would be preferred to use in my code ?

Here is an example of my grid using size=2

enter image description here


I don't know how to control size of points as you expect... would probably use geom_rect:

geom_rect(data = df, 
          aes(xmin = x-.025, xmax = x+.025, ymin = y-.025, ymax = y+.025), 
              alpha=0, colour="red", fill= "red"))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.