【问题标题】:How to make a dataset similar to that of murchison data in spatstat for ppm and AUc analysis如何在 spatstat 中制作类似于 murchison 数据的数据集以进行 ppm 和 AUc 分析
【发布时间】:2019-08-12 16:12:10
【问题描述】:
  1. 我有四个变量:物种的点过程模式 发生、河流、池塘多边形和陆地图像数据。我想 使用这些来制作类似于 Murchison 数据集的数据集 塑造层,但我没有操纵。

    我需要从这些多边形形状的图层中制作一个数据框 河流、池塘和土地覆盖图像以及点模式 我尝试使用超框架的物种出现数据,但我是 无法使用距离河流或池塘的距离功能。

    河流

    我想合并 这四个文件作为一个单一的 spatstat 对象,就像 Murchison 的一样 spatstat 软件包附带的数据。如果我能把它们放在一个框架里 那么池塘、土地覆盖、河流是协变量。

    我使用了分析功能,但返回的错误是不可能的 用作协变量,例如 x 是一个列表,不能用作 当我调用 dist 时,特别是池塘和河流的协变量 功能。

【问题讨论】:

标签: spatstat


【解决方案1】:

为什么需要hyperframe?你指的是murchison数据,那不是 hyperframe。它只是一个标准的 R list(带有扩展类 listof、anylist 和 solist 用于更好的打印和绘图 spatstat,但实际的数据结构只是一个普通的list)。

重新创建murchison 数据:

library(spatstat)
P <- murchison$gold # Points
L <- murchison$faults # Lines
W <- murchison$greenstone # "Windows

mur <- solist(points = P, lines = L, windows = W)
mur
#> List of spatial objects
#> 
#> points:
#> Planar point pattern: 255 points
#> window: rectangle = [352782.9, 682589.6] x [6699742, 7101484] metres
#> 
#> lines:
#> planar line segment pattern: 3252 line segments
#> window: rectangle = [352782.9, 682589.6] x [6699742, 7101484] metres
#> 
#> windows:
#> window: polygonal boundary
#> enclosing rectangle: [352782.9, 681699.6] x [6706467, 7100804] metres

要在模型中使用数据,不必将它们收集在一个列表中, 但这可能很方便。以下两个模型是相同的:

(mod1 <- ppm(P ~ W))
#> Nonstationary Poisson process
#> 
#> Log intensity:  ~W
#> 
#> Fitted trend coefficients:
#> (Intercept)       WTRUE 
#>  -21.918688    3.980409 
#> 
#>               Estimate      S.E.   CI95.lo    CI95.hi Ztest       Zval
#> (Intercept) -21.918688 0.1666667 -22.24535 -21.592028   *** -131.51213
#> WTRUE         3.980409 0.1798443   3.62792   4.332897   ***   22.13252
(mod2 <- ppm(points ~ windows, data = mur))
#> Nonstationary Poisson process
#> 
#> Log intensity:  ~windows
#> 
#> Fitted trend coefficients:
#> (Intercept) windowsTRUE 
#>  -21.918688    3.980409 
#> 
#>               Estimate      S.E.   CI95.lo    CI95.hi Ztest       Zval
#> (Intercept) -21.918688 0.1666667 -22.24535 -21.592028   *** -131.51213
#> windowsTRUE   3.980409 0.1798443   3.62792   4.332897   ***   22.13252

如果您坚持使用hyperframe,您应该为每个测量的 变量,但这些主要用于当您有多个复制时 一个实验,在这里用处不大。函数调用很简单:

murhyp <- hyperframe(points = P, lines = L, windows = W)

【讨论】:

  • 谢谢 Ege Rubak
  • 很高兴它有帮助。如果它解决了您的问题,请接受答案,以免将来的读者显示为未解决。
  • 我刚刚看到了这个平台上的新按钮。对此感到非常抱歉。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-12-26
  • 1970-01-01
  • 1970-01-01
  • 2023-04-07
  • 2016-11-30
  • 2022-11-11
  • 2021-12-06
相关资源
最近更新 更多