尝试从 esri shapefile 制作 spatstat 窗口
我已将 shapefile 转换为 SpatialPolygons 类,并将其转换为带有 as(x, "owin") 的窗口,但我找不到任何可以使用的
ppp(x, y, poly= _______ )
内容 我必须获取 shapefile 才能将其用作窗口在 PPP 对象中?
谢谢
I've converted the shapefile to class SpatialPolygons and that to a window with as(x, "owin") but I can't find anything that will work with
ppp(x, y, poly= _______ )
What format do I have to get the shapefile in to use it as a window in a PPP object?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Baddeley 最近发布了一个小插图,描述如何将 spatstat 与 shapefile 结合使用:请参阅 http://cran.r-project.org/web/packages/spatstat/vignettes/shapefiles.pdf
Baddeley recently published a vignette that describes how to use spatstat with shapefiles: see http://cran.r-project.org/web/packages/spatstat/vignettes/shapefiles.pdf
如果你有一个 ppp 对象
x
和一个 owin 对象W
,那么你只需这样做x <- x[W]
if you have a ppp object
x
and a owin objectW
, then you just dox <- x[W]
如果您已经将多边形 shapefile 转换为
owin
(窗口)对象W
,那么您只需使用该对象作为参数window
即可函数ppp
:X <- ppp(x, y, window=W)
之所以会出现混淆,是因为函数
ppp
允许用户以多种不同的方式指定边界窗口。本质上,它收集它无法识别的所有参数,并将它们传递给函数owin
,该函数使用它们来创建一个窗口。ppp
无法识别参数poly
,因此它将被传递给owin
:请参阅help(owin)
了解对此类论点的解释。If you have already converted your polygon shapefile to an
owin
(window) objectW
, then you can simply use this object as the argumentwindow
to the functionppp
:X <- ppp(x, y, window=W)
The confusion arises because the function
ppp
allows the user to specify the bounding window in many different ways. Essentially it gathers any arguments that it does not recognise, and passes them to the functionowin
which uses them to make a window. The argumentpoly
is not recognised byppp
so it would be passed toowin
: seehelp(owin)
for an explanation of such arguments.