Guest User

Untitled

a guest
May 22nd, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.96 KB | None | 0 0
  1.   x <- sapply(c(1:max(greens[,1])), function() {
  2.   # build polygon for row's green                                                                                                                                                                                
  3.     poly.x <- greens[greens[,1] == hole, 2]
  4.     poly.y <- greens[greens[,1] == hole, 3]
  5.   # get candidate points                                                                                                                                                                                          
  6.     p.x <- gps[,3]
  7.     p.y <- gps[,4]
  8.     require(sp)
  9.     # Finally increment the score for those positions in the green                                                                                                                                                
  10.     gps[which(point.in.polygon(p.x,p.y,poly.x,poly.y) != 0),ncol(gps)] <- gps[which(point.in.polygon(p.x,p.y,poly.x,poly.y) != 0),ncol(gps)] + 0.2
Add Comment
Please, Sign In to add comment