Re: [R-sig-Geo] Finding a way to select upper portion of cumulative probabilities in a map of probability estimates

2011-11-24 Thread Robert J. Hijmans
On Thu, Nov 24, 2011 at 2:31 PM, VanWilgenburg,Steve [Sas] < steve.vanwilgenb...@ec.gc.ca> wrote: > Hi Robert > > I only intended that spreadsheet as another way illustrate what it was I > was trying to accomplish. I have attached two ascii rasters and data and > functions in another file if that

Re: [R-sig-Geo] DEM interpolation with Delaunay triangulation

2011-11-24 Thread marcelino.delacruz
Thank you for your suggestions Edzer. I have rewritten the function (that now fits a linear trend on x and y), and have reconsidered a more appropriate name. I include a more ilustrative example with the Meuse data. Cheers, Marcelino maybetin <- function(X, nx, ny, x=NULL, y=NULL, na.v=0){

Re: [R-sig-Geo] Extract values with over()

2011-11-24 Thread Paulo Justiniano Ribeiro Jr
Edzer thanks for pointing this My complete solution goes a bit different without using returnList and taking advantege of the named vector returned by over() ## require(sp) set.seed(12) xy <- cbind(runif(n=500,min=0, max=20), runif(n=500,min=0, max=20)) ## points pontos <- SpatialPoi

Re: [R-sig-Geo] Finding a way to select upper portion of cumulative probabilities in a map of probability estimates

2011-11-24 Thread Robert J. Hijmans
Steve, The way to start is to write a function that does what you do on a vector (cell) or matrix (rows are cells). It should then be possible to call that that function with the 'calc' function. For example, to get the cumsum of sorted values, you can do fun <- function(x) cumsum(sort(x) ss <-

Re: [R-sig-Geo] combine function in R?

2011-11-24 Thread Robert J. Hijmans
Hi Jordan, Not that I know of, but I will write one for the raster package. For now, the below might work Best, Robert library(raster) # set up a stack with three layers r <- raster(nr=10, nc=10) s <- stack(sapply(1:3, function(x) setValues(r, round(runif(ncell(r)) # unique values us <- un

[R-sig-Geo] combine function in R?

2011-11-24 Thread Jordan Chamberlin
Hello list, Is there something like a combine function in R? I'm thinking of the COMBINE function in the old ArcInfo (which gives a grid of unique cell-wise combinations of integer values in a set of input grids). There must be something like that already written for R, but I'm new to this, s

Re: [R-sig-Geo] DEM interpolation with Delaunay triangulation

2011-11-24 Thread Edzer Pebesma
In that case, you might want to reconsider the name of this function, as TIN is something different from inverse distance weighted; if you are on an edge of the triangle, you need to get the straight line interpolation from the two z values on that edge, the third needs to get zero weight... On 11

Re: [R-sig-Geo] spatstat - affine a window - enlarging (with same center)

2011-11-24 Thread Mathieu Rajerison
Hi all, That's perfect. Mathieu 2011/11/23 Rolf Turner > > Marcelino is clearly far cleverer than I, since I was at first unable > to figure out what the problem was that Mathieu was complaining > of. As far as I can understand things, Marcelino's solution is correct. > > I can suggest a slig

Re: [R-sig-Geo] DEM interpolation with Delaunay triangulation

2011-11-24 Thread marcelino.delacruz
Hi all, Thanks to Rolf's suggestion I have incorporated the arguments x and y to let the user select the precise set of points where to interpolate. I have also corrected the formula (now is a inverse distance weighted interpolation) and have incorporated also the "power parameter" p as an argum

Re: [R-sig-Geo] Problem with tripGrid when some segments lie outside the study area

2011-11-24 Thread Michael Sumner
I see, I don't know then. That's not the way tripGrid is intended to be used so I will consider preventing that option from being set to FALSE for this usage. I've not explored why pixellate.psp does that in this case, but at any rate it is strictly about spatstat and not trip. Thanks for the hea

Re: [R-sig-Geo] Problem with tripGrid when some segments lie outside the study area

2011-11-24 Thread Pinaud David
Hi Michael, Yes, this error occured before, that's why I set firstly spatstat.options(checksegments=F) to avoid that. But in this case (checksegments=F), it seems that pixellate.psp() behaves "strangely" and adds time in cells that are not visited by the bird, in the border of the grid (see th