I am very new to R and am attempting to determine whether a shape file containing ~500k points is randomly distributed. and I keep getting the same error message no matter what I enter for the arguments.
Here is what I have from the start:
> 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>
so my next attempt was:
> 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
and my final attempts:
> 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
Like I said, I am very new at this and have only amateur python experience, but I am a grad student who needs to use this function for a project. Any help would be greatly appreciated.
Cheers