我对 R 非常陌生,正在尝试确定包含约 500k 点的形状文件是否是随机分布的。无论我输入什么参数,我都会收到相同的错误消息。
这是我从一开始就拥有的:
> library(spatstat)
spatstat 1.40-0 (nickname: ‘Do The Maths’)
For an introduction to spatstat, type ‘beginner’
> as.ppp(area)
marked planar point pattern: 500000 points
Mark variables:
[1] OBJECTID Encoded_Ti Time_ Filter Category Severity Action_ Hit_Count Profile Encoded_So Source_IP Source_Por Encoded_De
[14] Dest_IP Dest_Port VLAN_Tag Source_Cou Source_Reg Source_Cit Source_Lat Source_Lon Dest_Count Dest_Regio Dest_City Dest_Latit Dest_Longi
window: rectangle = [-159.964, 178.417] x [-46.4, 70.6349] units
Warning message:
some mark values are NA in the point pattern x
> quadrat.test(area)
Error in UseMethod("quadrat.test") :
no applicable method for 'quadrat.test' applied to an object of class "c('SpatialPointsDataFrame', 'SpatialPoints', 'Spatial')"
<bytecode: 0x0000000024e7a660>
<environment: namespace:spatstat>
所以我的下一个尝试是:
> X <- ppp(x, y, c(-159.964, 178.417), c(-46.4, 70.6349))
Warning message:
In ppp(x, y, c(-159.964, 178.417), c(-46.4, 70.6349)) :
data contain duplicated points
> quadrat.test(X)
Error in rectquadrat.countEngine(X$x, X$y, tess$xgrid, tess$ygrid) :
xbreaks do not span the actual range of x coordinates in data
和我最后的尝试:
> quadrat.test(X, nx = 20, ny = 20)
Error in rectquadrat.countEngine(X$x, X$y, tess$xgrid, tess$ygrid) :
xbreaks do not span the actual range of x coordinates in data
> quadrat.test(X, nx = 20, ny = 20, xbreaks= NULL, ybreaks = NULL)
Error in rectquadrat.countEngine(X$x, X$y, tess$xgrid, tess$ygrid) :
xbreaks do not span the actual range of x coordinates in data
> data(X)
Warning message:
In data(X) : data set ‘X’ not found
> quadrat.test(X)
Error in rectquadrat.countEngine(X$x, X$y, tess$xgrid, tess$ygrid) :
xbreaks do not span the actual range of x coordinates in data
> quadrat.test(X, 10)
Error in rectquadrat.countEngine(X$x, X$y, tess$xgrid, tess$ygrid) :
xbreaks do not span the actual range of x coordinates in data
就像我说的,我对此很陌生,只有业余 python 经验,但我是一名研究生,需要将此功能用于项目。任何帮助将不胜感激。
干杯