Re: [R-sig-Geo] how to get weights for inverse distance weighting

2017-04-07 Thread Edzer Pebesma
Scott, you may want to have a look at gstat::idw0 , which expresses the idw problem in a hand full of expressions, essentially idw0 = function (data, newdata, y, idp = 2) { s = coordinates(data) s0 = coordinates(newdata) D = 1/(spDists(s0, s)^idp) sumD = apply(D, 1, sum) D

[R-sig-Geo] how to get weights for inverse distance weighting

2017-04-07 Thread Waichler, Scott R
Hello, I am trying to get inverse distance weights to estimate values on a regular grid from a set of data points, over a sequence of times. The locations of the data points don't vary with time, but their values will with each instance, and in general some are NA. I want to determine the

Re: [R-sig-Geo] Raster math on a stack of large rasters

2017-04-07 Thread Melanie Bacou
Also take a look at using raster:: clusterR() in combination with calc() to use multiple cores. This works well if your your calculation function does not require neighboring cells. --Mel. On 04/07/2017 09:50 AM, Benjamin Leutner wrote: You could stick to the native raster format (grd), in

Re: [R-sig-Geo] Raster math on a stack of large rasters

2017-04-07 Thread Benjamin Leutner
You could stick to the native raster format (grd), in which case calc() writes to your final file directly. Of course that doesn't change the file size issue, but saves you the translation step to geotiff. For the file size you could consider restricting the datatype to integer (see