
Last chance! 50% off unlimited learning
Sale ends in
g1 <- graph.empty()
g2 <- graph( c(1,2,2,3,3,4,5,6), directed=FALSE )
adjm <- matrix(sample(0:1, 100, replace=TRUE, prob=c(0.9,0.1)), nc=10)
g3 <- graph.adjacency( adjm )
adjm <- matrix(sample(0:5, 100, replace=TRUE,
prob=c(0.9,0.02,0.02,0.02,0.02,0.02)), nc=10)
g4 <- graph.adjacency(adjm, weighted=TRUE)
E(g4)$weight
g5 <- graph.star(10, mode="out")
g6 <- graph.lattice(c(5,5,5))
g7 <- graph.lattice(length=5, dim=3)
g8 <- graph.ring(10)
g9 <- graph.tree(10, 2)
g10 <- graph.full(5, loops=TRUE)
g11 <- graph.atlas(sample(0:1252, 1))
el <- matrix( c("foo", "bar", "bar", "foobar"), nc=2, byrow=TRUE)
g12 <- graph.edgelist(el)
d <- as.data.frame(el)
d$weight <- 1:2
g13 <- graph.data.frame(d)
g14 <- graph.extended.chordal.ring(15, matrix(c(3,12,4,7,8,11), nr=2))
Run the code above in your browser using DataLab