[R-sig-Geo] How to calculate squared R of spatial autoregressive models

2010-11-22 Thread elaine kuo
Dear List, I am comparing the squared R values of linear models and its spatial autoregressive counterparts. (SARerror) (1. lm (Y~X1) 2. lm (Y~ X1+X2) 3. lm(Y~X1+X2+X3)) The squared R values of linear models are generated by command summary (lm). Similarly, I tried to produce those of

Re: [R-sig-Geo] How to calculate squared R of spatial autoregressive models

2010-11-22 Thread Roger Bivand
On Mon, 22 Nov 2010, elaine kuo wrote: Dear List, I am comparing the squared R values of linear models and its spatial autoregressive counterparts. (SARerror) (1. lm (Y~X1) 2. lm (Y~ X1+X2) 3. lm(Y~X1+X2+X3)) The squared R values of linear models are generated by command summary (lm).

[R-sig-Geo] Help to know a function to count how many elemant repeat in a data.farme

2010-11-22 Thread gianni lavaredo
Dear Researchers I am looking for a function to count how many elements repeats inside my data.frame and create a new data.frame as the following example. thanks and sorry for desturbing example mydata - data.frame(myfield=c(A,A,A,A,A,A,B,B,B,B,C,C,C,D,D)) #result myfiled count A 6 B 4 C 3 D

Re: [R-sig-Geo] Changing axes of a plot

2010-11-22 Thread Robert J. Hijmans
Ogbos, You can do this: library(raster) xy-cbind(x, y) r - rasterize(xy, raster(nrow=120, ncol=60), fun=sum) rb - rev(rainbow(255,s=1,v=1,start=0,end=7/12,gamma=1,alpha=1)) image(r, col=rb, ylab = Longitude, xlab=Latitude ) Or, in your code, instead of this z = t(grid3) this might work: z =

[R-sig-Geo] Changing axes of a plot: Problem Fixed

2010-11-22 Thread ogbos okike
Hi There, Raster package makes this an easy work!! I didn't have to wallow through my long code. Thank you to all those who contributed. Regards Ogbos On 22 November 2010 18:43, Robert J. Hijmans r.hijm...@gmail.com wrote: Ogbos, You can do this: library(raster) xy-cbind(x, y) r -

[R-sig-Geo] a problem with g.gisenv while running grass from R via spgrass6 on macosx

2010-11-22 Thread Jan Verbesselt
Hi, I am trying to run grass from R via the spgrass6 package on MacOSx while following this nice Wiki. I have installed the spgrass6 package from source on mac. grass-6.4 is also installed via the great website of KingChaos ( http://www.kyngchaos.com/software/grass). library(spgrass6) Loading

Re: [R-sig-Geo] a problem with g.gisenv while running grass from R via spgrass6 on macosx

2010-11-22 Thread Roger Bivand
On Mon, 22 Nov 2010, Jan Verbesselt wrote: Hi, I am trying to run grass from R via the spgrass6 package on MacOSx while following this nice Wiki. I have installed the spgrass6 package from source on mac. grass-6.4 is also installed via the great website of KingChaos (

Re: [R-sig-Geo] get() in raster ?

2010-11-22 Thread Agustin Lobo
Works for stack and not for brick: inMemory(N1) [1] FALSE v - list(N1, N2, N3) do.call(stack, v) class : RasterStack nlayers : 3 nrow: 1905 ncol: 3697 ncell : 7042785 projection : +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0 min value : 0

Re: [R-sig-Geo] a problem with g.gisenv while running grass from R via spgrass6 on macosx

2010-11-22 Thread Massimo Di Stefano
the path should be : /Application/GRASS-6.4.app/Contents/MacOS epy$ ls AUTHORS bin grass.sh CHANGES bwidget include COPYING docslib GPL.TXT driver man GRASS