我一直在尝试在不同的点之间生成LCP网络。我在一些数据集上取得了一些成功,但其他数据集在我尝试运行函数时会导致错误发生。所有数据都遵循相同的格式,并且驻留在相同的CRS中,所以我不知道问题出在哪里。我已经尝试了一些变通方法,但到目前为止还没有采取任何措施。我已经包含了我使用的基本脚本。
library(rgdal)
library(gdistance)
TRI<-raster("pathway.tif")
points<-readOGR("pathway.shp")
cost<-transition(TRI,sum,8)
LCP<-shortestPath(cost,points[1,],points[-1,],output="SpatialLines")这些参数对我的数据集的某些部分有效,但在我输入上面最后一行之后,其中几个参数显示了以下错误消息,并且我不确定修复方法是什么,因为我对R非常陌生:
Error in validObject(.Object) :
invalid class “SpatialLines” object: bbox should never contain infinite values
In addition: Warning messages:
1: In .Call("R_igraph_get_shortest_paths", graph, as.igraph.vs(graph, :
At structural_properties.c:4517 :Couldn't reach some vertices
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf
4: In min(x) : no non-missing arguments to min; returning Inf
5: In max(x) : no non-missing arguments to max; returning -Inf任何帮助或建议都是非常感谢的。谢谢!
https://stackoverflow.com/questions/44624475
复制相似问题