Re: [R-sig-Geo] How to negate %in%

2009-05-25 Thread JiHO
On 2009-May-25 , at 15:34 , Jim Burke wrote: Everyone's suggestions work. There are lots of roads to solutions in R. This is wonderful! There's even more. In the package Hmisc, there is a %nin% command that does what you want. It is less standard (requires an additional package) but more

Re: [R-sig-Geo] How to negate %in%

2009-05-25 Thread Jim Burke
Hi All, Everyone's suggestions work. There are lots of roads to solutions in R. This is wonderful! It seems that Dan's and Pedro's solutions work faster for my largish 1,897 spatial polygon data frame. Thanks, Jim Burke All replies are below. =

Re: [R-sig-Geo] How to negate %in%

2009-05-25 Thread Dan Putler
Sorry, I sent my initial reply only to Jim, not the list. Dan Forwarded Message From: Jim Burke To: Dan Putler Subject: Re: [R-sig-Geo] How to negate %in% Date: Mon, 25 May 2009 14:01:26 -0500 Thanks Dan, Both yours and Torleif's suggestions work with a SpatialPolygonsDataFr

Re: [R-sig-Geo] How to negate %in%

2009-05-25 Thread Torleif Markussen Lunde
Hi This (!) might work: aa <- 1:10 bb <- 5:6 aa[!aa %in% bb] [1] 1 2 3 4 7 8 9 10 aa[aa %in% bb] [1] 5 6 Best wishes Torleif On Monday 25 May 2009 08:13:40 pm Jim Burke wrote: > I can subset a "SpatialPolygonsDataFrame" from a > data frame containing a smaller subset of IDs. For > ex

[R-sig-Geo] How to negate %in%

2009-05-25 Thread Jim Burke
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

Re: [R-sig-Geo] [Soc] GRASS module for kriging - call for users [was: R-sig-Geo Digest, Vol 69, Issue 21]

2009-05-25 Thread Edzer Pebesma
Ebrahim Jahanshiri wrote: > for kriging a preliminary analysis is important. We should know if the data > has trend or how are the ouliers? should we remove them or not. Some of the > kriging techniques like universal kriging create very odd values at some > points if we dont deal with the data fri

Re: [R-sig-Geo] [Soc] GRASS module for kriging - call for users [was: R-sig-Geo Digest, Vol 69, Issue 21]

2009-05-25 Thread Ebrahim Jahanshiri
for kriging a preliminary analysis is important. We should know if the data has trend or how are the ouliers? should we remove them or not. Some of the kriging techniques like universal kriging create very odd values at some points if we dont deal with the data frist hand before kriging. I hope tha

Re: [R-sig-Geo] [Soc] GRASS module for kriging - call for users [was: R-sig-Geo Digest, Vol 69, Issue 21]

2009-05-25 Thread Anne Ghisla
Edzer Pebesma escribió: > I believe that many interpolation problems "out there" are simple, and > can be solved using geostatistics with a "finish" or "interpolate" > button. A question I find interesting is whether this button should > always do its best, or should it be so clever to warn the use

Re: [R-sig-Geo] [Soc] GRASS module for kriging - call for users [was: R-sig-Geo Digest, Vol 69, Issue 21]

2009-05-25 Thread Edzer Pebesma
I believe that many interpolation problems "out there" are simple, and can be solved using geostatistics with a "finish" or "interpolate" button. A question I find interesting is whether this button should always do its best, or should it be so clever to warn the user in case a problem is not "that

Re: [R-sig-Geo] deleting grid points outside boundary

2009-05-25 Thread Edzer Pebesma
Raphael, you could read your shapefile with readOGR in package rgdal, then use function overlay to find the points in the polygon, along the lines of: # grd is your full, rectangular grid # polygon is the shapefile you read require(sp) fullgrid(grd) = FALSE sel = !is.na(overlay(grd, polygon)) grd

[R-sig-Geo] deleting grid points outside boundary

2009-05-25 Thread Viscarra Rossel, Raphael (CLW, Black Mountain)
Hello, I have been using gstat to krige maps over my study area. The area is irregularly shaped and has quite a complex boundary. I have made a regular (square) grid that covers my study area and made my estimates on this grid. Now that I have my maps, I would like to 'mask out' or delete the