This is not possible. If you only know the locations of the nodes, the software cannot guess which nodes are connected by lines.
If you're starting from a shapefile you need to extract the lines of the network and convert them to a spatstat
class "psp"
object (planar segment pattern). Then you can use as.linnet
to form the network.
See Chapter 17 of the spatstat book