[R-sig-Geo] deleting duplicate observations in spatial dataset?

Nachman.Keeve at epamail.epa.gov Nachman.Keeve at epamail.epa.gov
Wed Sep 5 16:33:50 CEST 2007


Hello-

I apologize in advance for what is likely a newbie question, but here
goes:

In the geoR package, after using dup.coords to identify co-located data
points, is there an easy way to delete duplicate observations?  If it
makes things any easier, my duplicate observations/co-located points are
adjacent in the dataset.

For example, the command

dup.coords(spadata)

    dup   longfix   lat   data
977   1 -87.79917 42.14 0.0443
978   2 -87.79917 42.14 0.0352

And to be a bit more specific, rather than deleting duplicate
observations outright, I would prefer to establish some sort of criteria
for removal of duplicates - in the above case, I would like to keep the
observation with the larger data value.  Of course, if this isn't
possible, I'd be happy with any method to delete duplicates, and I can
deal with the selective deletion through a prior sort.

Any help would be much appreciated!

Keeve

Keeve Nachman, PhD, MHS
Public Health and Environmental Policy Team
National Center for Environmental Economics
US Environmental Protection Agency
1200 Pennsylvania Ave NW (1809T)
Washington, DC  20460
(O) 202-566-2279
(F) 202-566-2336




More information about the R-sig-Geo mailing list