externalFormats            package:Matrix            R Documentation

_R_e_a_d _a_n_d _w_r_i_t_e _e_x_t_e_r_n_a_l _m_a_t_r_i_x _f_o_r_m_a_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Read matrices stored in the Harwell-Boeing or MatrixMarket formats
     or write sparseMatrix objects to one of these formats.

_U_s_a_g_e:

     readHB(file)
     readMM(file)
     writeMM(obj, file, ...)

_A_r_g_u_m_e_n_t_s:

     obj: a real sparse matrix

    file: for 'writeMM' - the name of the file to be written. For
          'readHB' and 'readMM' the name of the file to read, as a
          character scalar.  The names of files storing matrices in the
          Harwell-Boeing format usually end in '".rua"' or '".rsa"'.
          Those storing matrices in the MatrixMarket format usually end
          in '".mtx"'.

          Alternatively, 'readHB' and 'readMM' accept connection
          objects.

     ...: optional additional arguments. Currently none are used in any
          methods.

_V_a_l_u_e:

     The 'readHB' and 'readMM' functions return an object that inherits
     from the '"Matrix"' class.  Methods for the 'writeMM' generic
     functions usually return 'NULL' and, as a side effect, the matrix
     'obj' is written to 'file' in the MatrixMarket format (writeMM).

_N_o_t_e:

     The Harwell-Boeing format is older and less flexible than the
     MatrixMarket format.  The function 'writeHB' was deprecated and
     has now been removed.  Please use 'writeMM' instead.

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://math.nist.gov/MatrixMarket>

     <URL: http://www.cise.ufl.edu/research/sparse/matrices>

_E_x_a_m_p_l_e_s:

     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")))
     ## Not run: 
     ## 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"))))
     ## End(Not run)
     data(KNex)
     writeMM(KNex$mm, "mmMM.mtx")

