library(igraph)
library(maptools)
pl <- readShapeLines("H:/data/Beijing_NatrualRoads.shp",proj4string=CRS("+proj=Mercator_Auxiliary_Sphere +datum=WGS84"))
pt <- readShapePoints("H:/data/Beijing_NatrualRoads_ND_Junctions.shp",proj4string=CRS("+proj=Mercator_Auxiliary_Sphere +datum=WGS84"))
Then errors occurs when trying to build graph using function "graph.data.frame":
> g <- graph.data.frame(pl, directed=FALSE, vertices=pt)
Error in graph.data.frame(pl, directed = FALSE, vertices = pt) :
Duplicate vertex names
Warning:
In graph.data.frame(pl, directed = FALSE, vertices = pt) :
In `d' `NA' elements were replaced with string "NA"
Could anyone help me to solve these problems, thank you very much.