inst/unitTests/clusterGraph_test.R

basicCluserGraph <- function() {
    new("clusterGraph", clusters=list(
                          a=c(1,2,3),
                          b=c(4,5,6)))
}

rename_nodes_test <- function() {
    g <- basicCluserGraph()
    checkEquals(as.character(1:6), nodes(g))
    nodes(g) <- letters[1:6]
    checkEquals(letters[1:6], nodes(g))
    checkEquals(letters[1:6], names(edges(g)))
}

Try the graph package in your browser

Any scripts or data that you put into this service are public.

graph documentation built on Nov. 8, 2020, 6:02 p.m.