str(pores <- readMM(system.file("external/pores_1.mtx",
package = "Matrix")))
str(utm <- readHB(system.file("external/utm300.rua",
package = "Matrix")))
str(lundA <- readMM(system.file("external/lund_a.mtx",
package = "Matrix")))
str(lundA <- readHB(system.file("external/lund_a.rsa",
package = "Matrix")))
## NOTE: The following examples take quite some time
## ---- even on a fast internet connection:
if(FALSE) # the URL has been corrected, but we need an un-tar step!
str(sm <-
readHB(gzcon(url("http://www.cise.ufl.edu/research/sparse/RB/Boeing/msc00726.tar.gz"))))
str(jgl009 <-
readMM(gzcon(url("ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/counterx/jgl009.mtx.gz"))))
data(KNex)
writeMM(KNex$mm, "mmMM.mtx")
## very simple export - in triplet format - to text file:
data(CAex)
s.CA <- summary(CAex)
message("writing to ", outf <- tempfile())
write.table(s.CA, file = outf, row.names=FALSE)
## and read it back -- showing off sparseMatrix():
dd <- read.table(outf, header=TRUE)
mm <- do.call(sparseMatrix, dd)
stopifnot(all.equal(mm, CAex, tol=1e-15))
Run the code above in your browser using DataLab