Re: [R-sig-Geo] enumerate grid clusters/patches with size of contiguous cluster

2008-03-12 Thread Murray Richardson
Thanks everyone for these responses I'm pulling in too many different code sources already so I think I'll try Roger's approach and keep it in R. Appreciate this. Murray Roger Bivand wrote: > On Wed, 12 Mar 2008, Agustin Lobo wrote: > >> and a combination of r.clump and r.stats >> in grass (

Re: [R-sig-Geo] [R] polygon shapefile from line edge coordinate list

2008-03-12 Thread Murray Richardson
Thakns Roger Since I am more familiar with postGIS I took that approach. It worked like a charm. I can post the script if you think it's worthwhile. Murra Roger Bivand wrote: > On Sun, 9 Mar 2008, Murray Richardson wrote: > >> Hi Roger >> >> Thanks so much for your help. I can definitely wor

Re: [R-sig-Geo] enumerate grid clusters/patches with size of contiguous cluster

2008-03-12 Thread Roger Bivand
On Wed, 12 Mar 2008, Agustin Lobo wrote: and a combination of r.clump and r.stats in grass (which is "linked" to R) can also do the job. Yes, that will be very robust. I've tried an R attack through neighbour lists: library(sp) data(meuse.grid) coordinates(meuse.grid) <- c("x", "y") gridded

Re: [R-sig-Geo] spplot with two rasters

2008-03-12 Thread Agustin Lobo
Well, the problem is that R does not have a real geographical display. While things can be done going back and forth from R to GIS, this procedure soon becomes very inconvenient. It's ok for learning and teaching, but not for real applications. Maybe getting an existing GIS to display spatial R obj

Re: [R-sig-Geo] spplot with two rasters

2008-03-12 Thread Roger Bivand
On Wed, 12 Mar 2008, Dylan Beaudette wrote: > On Thursday 06 March 2008, Thomas Adams wrote: >> Dylan, >> >> I think a solution using GRASS can be found on pages 110-111 of "Open >> Source GIS: A GRASS GIS Approach", 3rd Ed. The same material is covered >> in the 2nd Ed. as well, where you use r.m

Re: [R-sig-Geo] enumerate grid clusters/patches with size of contiguous cluster

2008-03-12 Thread Agustin Lobo
and a combination of r.clump and r.stats in grass (which is "linked" to R) can also do the job. Agus Andrew Niccolai escribió: > If you aren't dedicated to an R specific solution, ImageJ is open source and > does this under Analysis/Binary. > > -Original Message- > From: [EMAIL PROTECTED

Re: [R-sig-Geo] spplot with two rasters

2008-03-12 Thread Dylan Beaudette
On Thursday 06 March 2008, Thomas Adams wrote: > Dylan, > > I think a solution using GRASS can be found on pages 110-111 of "Open > Source GIS: A GRASS GIS Approach", 3rd Ed. The same material is covered > in the 2nd Ed. as well, where you use r.mapcalc to combine two rasters > and judicious use of

Re: [R-sig-Geo] enumerate grid clusters/patches with size of contiguous cluster

2008-03-12 Thread Andrew Niccolai
If you aren't dedicated to an R specific solution, ImageJ is open source and does this under Analysis/Binary. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Murray Richardson Sent: Wednesday, March 12, 2008 12:59 PM To: r-sig-geo@stat.math.ethz.ch Subject

[R-sig-Geo] enumerate grid clusters/patches with size of contiguous cluster

2008-03-12 Thread Murray Richardson
Hello friends, I am trying to take a binary input grid of patches (connected cells with value = 1), and assign to each non-zero cell the total number of pixels comprising the patch to which it belongs. So for a connected patch of 27 pixels, all cells belonging to that patch will have a value

Re: [R-sig-Geo] change a column name of the data slot

2008-03-12 Thread G. Allegri
Roger, I have to get experience yet... I thought that the right way to access the datas in Spatial*DataFrame should be through the use of slots. Thanks for the hint. Now things get easier! :-) 2008/3/12, Roger Bivand <[EMAIL PROTECTED]>: > On Wed, 12 Mar 2008, G. Allegri wrote: > > > I'm trying t

Re: [R-sig-Geo] change a column name of the data slot

2008-03-12 Thread Roger Bivand
On Wed, 12 Mar 2008, G. Allegri wrote: > I'm trying to change a column name of the data slot of a > SpatialPixelsDataFrame. > I've added the column this way: > >> slot(EceZKRIG0_3,"data")[,index]<-Sim_mean_approx[[2]] > > The column added is V151 (as 151 is the actual index). > I want to rename i

[R-sig-Geo] change a column name of the data slot

2008-03-12 Thread G. Allegri
I'm trying to change a column name of the data slot of a SpatialPixelsDataFrame. I've added the column this way: > slot(EceZKRIG0_3,"data")[,index]<-Sim_mean_approx[[2]] The column added is V151 (as 151 is the actual index). I want to rename it, and I've tried: > names(slot(EceZKRIG0_3,"data")[i

Re: [R-sig-Geo] geoR: specification of trend.d and trend.l in krige.control()

2008-03-12 Thread Paulo Justiniano Ribeiro Jr
Andre Let's see if I can get this. Some of the caracters I canot read (probably due to the encoding used in your email) On Wed, 12 Mar 2008, Andre Schützenmeister wrote: > Dear Subscribers, > I have some trouble in specifying the parameters trend.d and trend.l > correctly. > > As global trend I

[R-sig-Geo] spatial verions of negative binomial

2008-03-12 Thread Stratford, Jeffrey
Hi group, Does anyone have code for spatial error and spatial lag models for negative binomial distributions? There are spatial error and lag models in the Dormann et al. Ecography paper (a very nice read) but these fit linear models. Or is there a way to modify the Poison models? If code doe

Re: [R-sig-Geo] Package for automatic interpolation

2008-03-12 Thread Edzer Pebesma
I agree with Thomas that seeing a warning is a worry. If Paul's automap takes care of singular fits by discarding them, it should try to hide the warning for the user, because otherwise it will worry them. I see that the warning is issued by the C code in gstat, and will rethink about how a wra

[R-sig-Geo] geoR: specification of trend.d and trend.l in krige.control()

2008-03-12 Thread Andre Schützenmeister
Dear Subscribers, I have some trouble in specifying the parameters trend.d and trend.l correctly. As global trend I assume row and column effects which translate into the formula: trend=~factor(Row)+factor(Column) Consequently, I obtain the parameters of a the model via variofit

Re: [R-sig-Geo] Package for automatic interpolation

2008-03-12 Thread Paul Hiemstra
Hi Thomas, The automatic fitting procedure checks a range of possible variogram models, including Spherical, Exponential, Gaussian and Matern models. Each of these models could lead to a singular model fit. The fitting function in gstat (fit.variogram) says the following on singular model fits:

Re: [R-sig-Geo] Package for automatic interpolation

2008-03-12 Thread Thomas Adams
Paul, This is outstanding; thank you very much! BTW, I noticed that when I run your example that I get: Warning: singular model in variogram fit …actually, 2 such warnings with the OK example, and 1 with the UK example. Are you seeing these too? Otherwise, the results look fine… Thanks again