R: fixed undirected, weighted, sparse constructor, #554.