Re: [R-sig-Geo] algorthirm to join polygons based on population properties

2014-01-07 Thread Roger Bivand
On Tue, 7 Jan 2014, James Rooney wrote: Dear all, I have dataset with very many more polygons than cases. I wish to apply Bayesian smoothing to areal disease rates, however I have too many polygons and need a smart way to combine them so that there are less overall polygons. Bascially I

Re: [R-sig-Geo] algorthirm to join polygons based on population properties

2014-01-07 Thread James Rooney
Hi Roger, Thanks for your reply. Coding the joins is not a problem I've already done that on a smaller scale in a different project. No postcodes in my country. I have polygon data from the census and I have geocoded cases for every case of a rare disease. This is all pretty much fixed there

Re: [R-sig-Geo] algorthirm to join polygons based on population properties

2014-01-07 Thread Roger Bivand
On Tue, 7 Jan 2014, James Rooney wrote: Hi Roger, Thanks for your reply. Coding the joins is not a problem I've already done that on a smaller scale in a different project. No postcodes in my country. I have polygon data from the census and I have geocoded cases for every case of a rare

Re: [R-sig-Geo] algorthirm to join polygons based on population properties

2014-01-07 Thread James Rooney
Ok thanks Roger I'll read up on that! Many thanks! James From: Roger Bivand [roger.biv...@nhh.no] Sent: 07 January 2014 10:12 To: James Rooney Cc: r-sig-geo@r-project.org Subject: Re: [R-sig-Geo] algorthirm to join polygons based on population properties

Re: [R-sig-Geo] algorthirm to join polygons based on population properties

2014-01-07 Thread Kuroda
Professor Rooney: As professor Bivand remarked, key words are regionalization, region building, zoning design, or constrained spatial clustering. Cf. Duque, J. C., Ramos, R. and Surinach, J. (2007) Supervised regionalization methods: International Regional Science Review, 30 (3), 195-220. It

Re: [R-sig-Geo] algorthirm to join polygons based on population properties

2014-01-07 Thread James Rooney
Dear Mr Kuroda, Many thanks for the information. I will have to take some time to digest the various links I've been sent, and learn the new lingo! And I appreciate the honorary promotion, but it is not 'Professor' Rooney at all! Dr Rooney if you like titles - though I personally much prefer

Re: [R-sig-Geo] Prototyping some new features in rasterEngine...

2014-01-07 Thread Jonathan Greenberg
Doh, sent the wrong examples. Swap in rasterEngine for focal_hpc (generally, avoid using focal_hpc) install.packages(spatial.tools, repos=http://R-Forge.R-project.org;) library(spatial.tools) # sfQuickInit() # Uncomment out to run in parallel tahoe_highrez -

Re: [R-sig-Geo] algorthirm to join polygons based on population properties

2014-01-07 Thread Virgilio Gómez-Rubio
Dear James, In addition to what others have suggested, you may want to try a different modelling approach using zero-inflated models. If you are working on a rare disease, a zero-inflated model can accommodate the high number of zeroes better than standard models. Best wishes, Virgilio On mar,

[R-sig-Geo] Rasterize polygons

2014-01-07 Thread Tim Sippel
Hi- I need to count the number of observations in each of 8 polygons. I'm using the raster package for this, but am having trouble getting what I need. Why am I getting a count of 1 in each of the polygons defined below? Sample data can be downloaded here:

Re: [R-sig-Geo] Rasterize polygons

2014-01-07 Thread Robert J. Hijmans
Tim, To count the number of points (obsdeep) in each polygon, you can do: table( over(SpatialPoints(obsdeep), poly) ) There is no role for rasterizing polygons here. But to answer your question: you are getting a count of 1 because there is never more than 1 polygon that matches a raster cell

Re: [R-sig-Geo] Rasterize polygons

2014-01-07 Thread Tim Sippel
Thanks Robert, much appreciated. On Tue, Jan 7, 2014 at 1:57 PM, Robert J. Hijmans r.hijm...@gmail.comwrote: Tim, To count the number of points (obsdeep) in each polygon, you can do: table( over(SpatialPoints(obsdeep), poly) ) There is no role for rasterizing polygons here. But to answer