# NOT RUN {
data(ORN)
pts<-spsample(rn, 100, type="random")
ptsxy<-coordinates(pts)[,1:2]
ptsxy<-cbind(ptsxy[,1]+0.008,ptsxy[,2]+0.008)
#Mapping each point to the nearest node in the network/graph
res<-points2network(ntdata=rn,pointsxy=ptsxy, mapping.method=1)
#Visualize the results without virtual edges
ptsinnt.view(ntdata=rn, nodelist=res[[1]], pointsxy=ptsxy,
CoorespondIDs=res[[3]])
#Visualize the results with virtual edges
res<-points2network(ntdata=rn,pointsxy=ptsxy, mapping.method=3,
ea.prop=rep(0,37))
VElist<-res[[7]]
ptsinnt.view(ntdata=rn, nodelist=res[[1]], pointsxy=ptsxy,
CoorespondIDs=res[[3]], VElist=VElist)
# }
Run the code above in your browser using DataLab