An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20060620/7915081a/attachment.pl>
whatis wrong with my testing for CSR using F/G function?
4 messages · zhijie zhang, Barry Rowlingson, Roger Bivand
zhijie zhang wrote:
grid.pts<-gridpts(polymap(bbox(pts)),10*np) *#error in bbox(poly) : object not a >= 2-column array* I don't know why it is wrong.
I explained this to you yesterday, but your email address was different. So far I've seen you use three different email addresses! If you keep to one email then life will be much simpler! The polymap() function call here is wrong - it is used to draw a polygon. Just remove it and do: grid.pts <- gridpts(bbox(pts),10*np) this produces a grid of 10*np points in the bounding box of the points in pts. You can then use polymap() to see them: polymap(bbox(pts)) pointmap(grid.pts,add=T) Barry
Barry Rowlingson wrote:
polymap(bbox(pts)) pointmap(grid.pts,add=T)
Okay, there's another reason this doesn't work: splancs now requires the 'sp' package which defines a 'bbox' function that doesn't do the same thing as the one in splancs. I dimly recall Roger noting this sometime ago! There's now a 'bboxx' function (two 'x's at the end) in splancs that does what the old splancs 'bbox' function did. So if you do: grid.pts<-gridpts(bboxx(pts),10*np) pointmap(grid.pts,add=T) it should work. I did test my earlier solution, just not with a current version of splancs. Barry
On Tue, 20 Jun 2006, Barry Rowlingson wrote:
Barry Rowlingson wrote:
polymap(bbox(pts)) pointmap(grid.pts,add=T)
Okay, there's another reason this doesn't work: splancs now requires the 'sp' package which defines a 'bbox' function that doesn't do the same thing as the one in splancs. I dimly recall Roger noting this sometime ago!
Thanks, Barry, I think that is right - without knowing which version of splancs the questioner is using. So again, when asking a question about problems with code, please include the output of sessionInfo(). I have a feeling that this is in part the same question that I replied to yesterday using sp and spatstat. Roger
There's now a 'bboxx' function (two 'x's at the end) in splancs that does what the old splancs 'bbox' function did. So if you do: grid.pts<-gridpts(bboxx(pts),10*np) pointmap(grid.pts,add=T) it should work. I did test my earlier solution, just not with a current version of splancs. Barry
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no