Re: [R-sig-Geo] Comparison of prediction performance (mapping accuracy) - how to test if a method B is significantly more accurate than method A?

2014-08-30 Thread Jean-Daniel Sylvain
Dear Tom/list, The subject could also be look as the same problem encoutered in ensemble forecast (e.g. meteorology). If you could have more folders in your analysis (you can see each folder as a member of an ensemble) you could compare the two methods as it is done in ensemble forecast, in

Re: [R-sig-Geo] Issue saving ascii with writeRaster function

2014-08-30 Thread Robert J. Hijmans
Damien, The default setting is to write Real numbers, hence the 1.000 (which is needed to trick GDAL and ESRI to not assume that the values are all integers when the first numbers have no decimals). If you want integers, you can do writeRaster(r, filename = test.asc,

Re: [R-sig-Geo] raster to dataframe with xy=TRUE, na.rm=TRUE

2014-08-30 Thread Robert J. Hijmans
Helen, This is a bug, thanks for reporting it. I have fixed it in (development) version 2.2-43 Robert On Fri, Aug 29, 2014 at 8:22 AM, Helen Sofaer he...@rams.colostate.edu wrote: Thanks Pascal, That's helpful. I am curious about what happened in the second example, if anyone else takes a

Re: [R-sig-Geo] distance between raster cell centroids and spatial points

2014-08-30 Thread Robert J. Hijmans
Gabriele, I think you can do: library(raster) x - distanceFromPoints(ras, villages) Robert On Mon, Jul 28, 2014 at 6:56 AM, Gabriele Cozzi gab.co...@gmail.com wrote: Dear list, I want to calculate the distance between the centroid of each cell in a raster ‘ras’ and the closest village

Re: [R-sig-Geo] Unexpected behavior of raster mask function

2014-08-30 Thread Robert J. Hijmans
Alex, Thanks for the clear example. I had not considered that case. I have added an argument 'updateNA' to the mask function (version 2.2-43) such that you can do: masked_image - mask(img, msk, updatevalue=2, updateNA=TRUE) That is, if updateNA is TRUE, NA cells outside the mask are also

Re: [R-sig-Geo] Verify units of distance between coordinates

2014-08-30 Thread Robert J. Hijmans
library(geosphere) d - distCosine(df[, 1:2], df[,3:4]) On Thu, Aug 28, 2014 at 8:02 AM, Roger Bivand roger.biv...@nhh.no wrote: On Thu, 28 Aug 2014, Roger Bivand wrote: On Thu, 28 Aug 2014, Sarah Goslee wrote: On Thu, Aug 28, 2014 at 9:32 AM, Michael Sumner mdsum...@gmail.com wrote: On

Re: [R-sig-Geo] Raster Layers same resolution but not the same coordinates over the same area

2014-08-30 Thread Robert J. Hijmans
Justin, The RasterStack approach is fine, but as you show, the layers do not match. The resolution of NDVIStack is larger than the resolution of rainStack; it seems that you did not resample the NDVI data correctly. Robert On Sat, Aug 30, 2014 at 4:31 AM, Justin Michell jwm...@gmail.com

Re: [R-sig-Geo] raster brick error cells are not equally spaced

2014-08-30 Thread Robert J. Hijmans
Dave, The code now works on both machines. Perhaps it works, but the results are probably incorrect. There always a check for non-regularly spaced values, but some cases slipped through. This has now been fixed. Robert On Tue, Aug 19, 2014 at 12:42 PM, Chagaris, Dave dave.chaga...@myfwc.com

Re: [R-sig-Geo] plotting raster returns error about NA

2014-08-30 Thread acocac
Hi, Did you solve this problem, how large is your raster file? Alejandro -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/plotting-raster-returns-error-about-NA-tp7586834p7587036.html Sent from the R-sig-geo mailing list archive at Nabble.com.

Re: [R-sig-Geo] image(rs) returns error after reclassify

2014-08-30 Thread Robert J. Hijmans
Herry, This is caused by a call to as.integer(cell numbers) which leads to NAs as as.integer(ncell(rs)) returns NA I have removed the call to as.integer in version 2.2-43 and this works now (and it does not seem to mess up other things). Thanks for reporting this, Robert On Thu, Jul 17, 2014 at

Re: [R-sig-Geo] Randomly moving a locality (within set limits)

2014-08-30 Thread Robert J. Hijmans
I think this is implemented as the destPoint function in the geosphere package. Robert On Mon, Aug 25, 2014 at 1:26 AM, Frede Aakmann Tøgersen fr...@vestas.com wrote: Hi The following is based on http://www.movable-type.co.uk/scripts/latlong.html. foo - function(origin, bearing, distance){