I am working in the spatstat package in R and I would like to create an object of "linnet" (network) class from a shapefile. Unfortunately, while I am able to obtain the locations of all nodes in the network from the ArcGIS, I cannot figure out the way to obtain the list of edges or adjacency matrix, which are necessary to build an object of class "linnet" in spatstat. So how to obtain either one (list of edges in network or vertices adjacency matrix) is my question.
If you have any piece of code that deals with this problem, or any advice I would highly appreciate it.
Below is the description of the object class from the spatstat documentation.
Many thanks in advance,
Description Creates an object of class "linnet" representing a network of line segments. Usage linnet(vertices, m, edges) Arguments vertices - Point pattern (object of class "ppp") specifying the vertices of the network. m - Adjacency matrix. A matrix of logical values equal to TRUE when the corresponding vertices are joined by a line. (Specify either m or edges.) edges - Edge list. A two-column matrix of integers, specifying all pairs of vertices that should be joined by an edge. (Specify either m or edges.)