How to convert a graph into a sparse adjacency matrix having a given type (other then “dgCMatrix”)
library(igraph) library(Matrix) g <- make_ring(5) adj <- as_adjacency_matrix(G, sparse = TRUE) class(adj) # [1] “dgCMatrix” # attr(,”package”) # [1] “Matrix” How to specify a matrix class other then “dgCMatrix”, which seem to be the default. adt <- as(adj, “TsparseMatrix”) class(adt) # [1] “dgTMatrix” # attr(,”package”) # [1] “Matrix” I tried: class(as_adj(g, type=”both”, igraph_opt(“dgTMatrix”))) but this […]