How to use maps::map.where() to identify locations in the non-mainland U.S.?

The handy maps::map.where() function takes a latitude and longitude and returns what country, U.S. state, or U.S. county the location contains it. However, the database it uses for U.S. states inconveniently only works for the mainland U.S. Is there a way to include the non-mainland U.S. (e.g., Alaska and Hawaii, Puerto Rico, and others)?

The package mapdata Natural Earth does contains these, but not at the county level.

According to maps' readme, you also have a possibility of importing shapefiles, that you should be able to find online.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.