I am still a beginner to R and I have the following problem. Any tips will be highly appreciated - it will be a big help to start off. I have a road shapefile for one country in ArcGIS, that I would like to use as a network variable in R to apply network K-function (look for point randomness on the network using spatstat package). I have never worked with this type of problem before in R and I can't figure out how to convert the vector line dataset into network variable in R. I tried to used the shapefile package, but after reading the .shp, .shx and .dbf files, I don't know how it can be used any further.

有帮助吗?

解决方案

The comments above are not correct.

In the spatstat package, first convert your shapefile to an object of class "psp" (planar segment pattern) as explained in the accompanying vignette on shapefiles.

Then use the function as.linnet to convert the "psp" object to a linear network object of class "linnet".

For more explanation, see chapter 17 of the spatstat book.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top