Re: [R-sig-Geo] Local Moran p-values in Geoda, Python, and R

2015-03-12 Thread Roger Bivand
On Wed, 11 Mar 2015, William May wrote: I sent this to Roger Bivand earlier. Posting it here for posterity, and in case other people have more to add: --- Hi Roger, I'm taking a spatial econometrics class, and we've been

Re: [R-sig-Geo] Local Moran p-values in Geoda, Python, and R

2015-03-12 Thread Roger Bivand
On Thu, 12 Mar 2015, William May wrote: Here's the R LISA map: http://willonrails.com/images/Lisa_map_R.png And here's the Geoda version: http://willonrails.com/images/Lisa_map_geoda.png I'm using Geoda 1.6.6. Since we were getting inconsistent answers between R and Geoda, the professor ran

Re: [R-sig-Geo] gdistance: costDistance with barriers

2015-03-12 Thread Robert J. Hijmans
Karl, You are using a default RasterLayer which has lon/lat coordinates. In that case the earth is considered spherical (or similar), not a plane. The maximum possible distance in longitude is 180 degrees, and the distance between -120 and 120 is not 240 degrees, but 60+60= 120 degrees, . To get

Re: [R-sig-Geo] gdistance: costDistance with barriers

2015-03-12 Thread Stachelek, Joseph
Hi Karl, I think the underlying shortest.paths algorithm is wrapping around the x dimension of the raster. I was able to fix by remove vertices in the underlying adjacency matrix. library(gdistance) r - raster(nrows=18, ncols=36) r[] - 1 t - transition(r,function(x) 1/mean(x),4) p -

[R-sig-Geo] gdistance: costDistance with barriers

2015-03-12 Thread karljarvis
Hi all, I am seeing confusing behavior from the costDistance function in gdistance. In general, when cost is constant, cost distance increases linearly with actual distance. However, in this example, it is not doing that for the longest few distances. Am I missing something? Karl r -

Re: [R-sig-Geo] gdistance: costDistance with barriers

2015-03-12 Thread karljarvis
Apologies for the confusing subject line... - Karl Jarvis -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/gdistance-costDistance-with-barriers-tp7587891p7587892.html Sent from the R-sig-geo mailing list archive at Nabble.com.

[R-sig-Geo] problem in weigths of the extract function

2015-03-12 Thread Daniel Varajão de Latorre
Dear list, I recently upgraded the raster library and a script that used to run perfectly gave me some mistakes. The problem was in the extract function: r - raster(nrows=180, ncols=360, xmn=-180, xmx=180, ymn=-90, ymx=90) r[] - 1 extract(x = r, y = world_map, weights=T, cellnumber=T) I've

Re: [R-sig-Geo] gdistance: costDistance with barriers

2015-03-12 Thread Jacob van Etten via R-sig-Geo
Robert is right. This example visualizes what is happening. library(gdistance)r - raster(nrows=18, ncols=36) r[] - 1x - transition(r,function(x) 1/mean(x),4)origin - c(-120,0)goal - c(120,0)sl - shortestPath(x, origin, goal)plot(raster(sl)) On Thursday, 12 March 2015, 14:50, Robert J.

Re: [R-sig-Geo] gdistance: costDistance with barriers

2015-03-12 Thread Karl Jarvis
Great! Thank you all. On Mar 12, 2015, at 4:35 PM, Jacob van Etten jacobvanet...@yahoo.com wrote: Robert is right. This example visualizes what is happening. library(gdistance) r - raster(nrows=18, ncols=36) r[] - 1 x - transition(r,function(x) 1/mean(x),4) origin - c(-120,0) goal -