简体   繁体   English

寻找使用`linearKEuclid`和`spatstat`的相应功能的方法

[英]Searching for a way to use `linearKEuclid` and corresponding functions of `spatstat`

My goal is to analyse simple point patterns on linear networks with respect to Euclidean distance instead of shortest-path distance implemented in linearK and related functions of spatstat and its sub packages.我的目标是分析线性网络上关于欧几里得距离的简单点模式,而不是在linearK中实现的最短路径距离以及spatstat及其子包的相关函数。 Browsing through the web I found the promising named function linearKEuclid() and related functions here .浏览 web 我在这里找到了名为 function linearKEuclid()和相关函数的有前途的函数。

Unfortunately, I could not bring those functions to live on my Win machine, eg I run in errors like this不幸的是,我无法在我的 Win 机器上使用这些功能,例如,我在这样的错误中运行

Error in xysegMcircle(Y$x, Y$y, D, df$x0, df$y0, df$x1, df$y1) : 
object 'C_circMseg' not found

or或者

Error in tapply(stuff$sinalpha, list(ii, jj), harmonicsum) :
object 'harmonicsum' not found

There is always something missing.总是缺少一些东西。 For me, this means simply copying missing functions from the web, if available, does not help.对我来说,这意味着简单地从 web 中复制缺失的功能(如果有的话)并没有帮助。 Probably, a reason for this is that the functions are merely written for internal purposes and under internal development, see, for instance, here under "Details".原因可能是这些函数只是为内部目的而编写的,并且在内部开发中,例如,请参见此处的“详细信息”。

However, I am hoping for some recommendation making the fascinating code around linearKEuclid() runnable on my machine.但是,我希望有人提出建议,让有关linearKEuclid()的迷人代码可以在我的机器上运行。 Maybe, there are some chances that someone draws my attention to a downloadable developer version or something comparable.也许,有些人可能会引起我对可下载的开发人员版本或类似的东西的注意。 Many thanks in advance!提前谢谢了!

I understand your confusion and it is unnecessarily complicated to get this to work at the moment since problems with another package on CRAN prevents spatstat and subpackages to be updated at the moment.我理解您的困惑,因为目前 CRAN 上的另一个 package 的问题阻止了 spatstat 和子包的更新,所以目前让这个工作变得不必要地复杂。 Indeed you need to install a development version of spatstat.linnet and its dependencies.实际上,您需要安装spatstat.linnet的开发版本及其依赖项。 This is most easily done if you have the package remotes installed (and necessary tools to compile packages from source which would be RTools on Windows):如果您安装了 package remotes (以及从源代码编译软件包的必要工具,即 Windows 上的RTools ),这将最容易完成:

First run (in sequence):第一次运行(按顺序):

remotes::install_github("spatstat/spatstat.random")
remotes::install_github("spatstat/spatstat.sparse")
remotes::install_github("baddstats/spatstat.explore")
remotes::install_github("baddstats/spatstat.model")
remotes::install_github("spatstat/spatstat.linnet")

Now the function should work (you may have to restart R if an old version of spatstat.linnet was already loaded when you updated).现在 function 应该可以工作了(如果您在更新时已经加载了旧版本的 spatstat.linnet,您可能需要重新启动 R)。 Try eg the example from the help file:尝试例如帮助文件中的示例:

library(spatstat.linnet)
X <- rpoislpp(5, simplenet)
K <- linearKEuclid(X)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM