[R] Excluding coordinates that fall within a circle

MacQueen, Don macqueen1 at llnl.gov
Fri Jun 17 20:09:12 CEST 2016


This would be a good question for R-sig-geo.

To do it properly, there would be a few steps:

1. transform from lat/long (units=degrees) to projected coordinate system
(units = meters)

2. find one of the R functions for calculating distances (there are
several)

3. subset the data according to your distance threshold

The sp package provides a lot of the fundamental tools for these kinds of
things.

The spDists() function in the sp package may take care of both steps 1 and
2.

The overhead required to learn R's spatial capabilities can be
significant, but I think will be worth it if you will be needing to do a
lot of spatial manipulations.

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 6/17/16, 10:26 AM, "R-help on behalf of Alice Domalik"
<r-help-bounces at r-project.org on behalf of adomalik at sfu.ca> wrote:

>Hi List, 
>
>I'm working with some bird tracking data, and to filter the data set, I
>need to exclude points taken at the colony.
>I would like to exclude coordinates from within a 500 meter radius of a
>point centered on the colony.
>However, as an R novice, I'm not sure how to accomplish this.
>
>My df looks like this:
>
>AnimalID Latitude Longitude Datetime
>
>Any suggestions would be greatly appreciated.
>
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list