Skip to content
Back to formatted view

Raw Message

Message-ID: <1DDAFB67-9DC0-4206-8F5F-ED0B5E11CACE@exeter.ac.uk>
Date: 2009-05-27T16:14:26Z
From: Baptiste Auguie
Subject: How to negate %in%
In-Reply-To: <4A1ADFD4.800@earthlink.net>

I like to use this one (albeit probably not the most efficient),

`%ni%` <- Negate(`%in%`)

baptiste

On 25 May 2009, at 20:13, Jim Burke wrote:

> I can subset a "SpatialPolygonsDataFrame" from a
> data frame containing a smaller subset of IDs. For
> example below.
>
> smaller_sp <- large_sp [large_sp$ID %in% smaller_df$ID,]
>
> Given the above how can I do the logically opposite from
> the %in% operation and get all those IDs not %in%?
>
> I am processing two different sets of polygons (A,B) in
> a loop. Operation is seeing in center points in polys B
> fall in A. I would like to remove the spatial polygons
> that I found (B) as I traverse the geographical area.
>
> Thanks,
> Jim Burke
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo