Skip to content
Prev 156315 / 398506 Next

Blank certain areas of a contour plot

On 9/17/2008 2:29 PM, Victor Homar wrote:
Yes, you use the map.where function to identify the location of the 
points.  If NA, it's out in the ocean somewhere.  Some lakes and 
interior seas will probably be identified by name.  For example, here's 
what I get when clicking on some regions in the world map:

 > map("world")
 > loc <- locator()
 > loc
$x
[1]  -47.35604 -150.58010 -114.14808  -86.82406

$y
[1] 33.67133 42.77815 62.20602 44.59951

 > map.where(x=loc$x, y=loc$y)
[1] NA
[2] NA
[3] "Canada"
[4] "Great Lakes:Superior, Huron, Michigan"

I believe all of those locations were in the oceans (1 and 2) or lakes 
(3 and 4).

Duncan Murdoch