View source: R/download_graph.R
download_graph | R Documentation |
download_graph
allows to download sparse matrices from the SuiteSparse Matrix Collection.
download_graph(matrixname, groupname, svd = FALSE, add_info = FALSE)
matrixname |
Name of the graph to download. |
groupname |
Name of the group that provides the graph. |
svd |
Logical, if |
add_info |
Logical, if |
download_graph
automatically converts the downloaded matrix into a sparse matrix format. If coordinates are associated with the graphs, they are downloaded and included in the output. Visit https://sparse.tamu.edu/ or see SuiteSparseData
to explore groups and matrix names.
A list containing several components:
sA
: A sparse matrix representation of the downloaded graph.
xy
: Coordinates associated with the graph nodes (if available).
dim
: A data frame with the number of rows, columns, and numerically nonzero elements.
temp
: The path to the temporary directory where the matrix and downloaded files (including singular values if requested) are stored.
info
: Additional information about the graph (included when add_info
is TRUE
).
This temporary directory can be accessed, for example, via list.files(grid1$temp)
. To open the read .mat files (containing singular values), "R.matlab" or "foreign" packages can be used. After using the downloaded data, you can delete the content of the temporary folder.
When add_info
is set to TRUE
, the function retrieves comprehensive information about the graph using get_graph_info
.
Davis, T. A., & Hu, Y. (2011). The University of Florida sparse matrix collection. ACM Transactions on Mathematical Software (TOMS), 38(1), 1-25.
Kolodziej, S. P., Aznaveh, M., Bullock, M., David, J., Davis, T. A., Henderson, M., Hu, Y., & Sandstrom, R. (2019). The suitesparse matrix collection website interface. Journal of Open Source Software, 4(35), 1244.
get_graph_info
, SuiteSparseData
## Not run:
matrixname <- "grid1"
groupname <- "AG-Monien"
download_graph(matrixname,groupname)
list.files(grid1$temp)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.