Something like:
library(igraph)
g <- as.data.frame(cbind(matrix(c(1, 2, 1, 3, 1, 4, 3, 4, 2, 4),
byrow = TRUE, ncol = 2),
c(5.6, 2.7, 3.5, 1.8, 2.1)))
names(g) <- c("start", "end", "length")
g <- graph.data.frame(g, directed = FALSE)
# add node 5
g <- g + vertices(5)
# delete edge 1-2
g["1", "2"] <- NULL
# add new edges with length attribute
g <- g + edge("1", "5", attr=list(length=2.6))
g <- g + edge("2", "5", attr=list(length=1.3))
plot(g)