download_graph: Download Sparse Matrix form the SuiteSparse Matrix Collection

View source: R/download_graph.R

download_graphR Documentation

Download Sparse Matrix form the SuiteSparse Matrix Collection

Description

download_graph allows to download sparse matrices from the SuiteSparse Matrix Collection.

Usage

download_graph(matrixname, groupname, svd = FALSE)

Arguments

matrixname

Name of the graph to download.

groupname

Name of the group that provides the graph.

svd

Logical, if TRUE, a ".mat" file containing the singular values of the matrix is downloaded (if available). Default is FALSE.

Details

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/ to explore groups and matrix names.

Value

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.

Note

This temporary directory can be accessed, for example, via list.files(grid1$info). 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.

References

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.

See Also

get_graph_info

Examples

## Not run: 
matrixname <- "grid1"
groupname <- "AG-Monien"
download_graph(matrixname,groupname)
list.files(grid1$info)

## End(Not run)

gasper documentation built on Oct. 27, 2023, 1:07 a.m.