print.matrix              package:base              R Documentation

_P_r_i_n_t _M_a_t_r_i_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Pseudo-method for the `print' generic.  Especially useful with the
     `right' argument which does not (yet) exist for `print.default'.

_U_s_a_g_e:

     print.matrix(x, rowlab=character(0), collab=character(0),
                  quote=TRUE, right=FALSE, na.print = NULL,
                  print.gap = NULL, ...)

_A_r_g_u_m_e_n_t_s:

       x: numeric or character matrix.

rowlab,collab: (optional) character vectors giving row or column names
          respectively.  By default, these are taken from
          `dimnames(x)'.

   quote: logical; if `TRUE' and `x' is of mode `"character"', quotes
          (`".."') are used.

   right: if `TRUE' and `x' is of mode `"character"', the output
          columns are right-justified.

na.print: how `NA's are printed.  If this is non-null, its value is
          used to represent `NA'.

print.gap: not yet used.

     ...: arguments for other methods.

_D_e_t_a_i_l_s:

     `print.matrix' and `print.default' both print matrices, and each
     has at least an optional argument that the other lacks.  Also,
     both directly dispatch into `.Internal' code directly instead of
     relying on each other. This mainly stems from historic
     compatibility and similar reasons should be changed in the future.

     `prmatrix' is currently just an `.Alias' for `print.matrix'.

_V_a_l_u_e:

     Invisibly returns its argument, `x'.

_S_e_e _A_l_s_o:

     `print.default', and other `print' methods.

_E_x_a_m_p_l_e_s:

     print.matrix(m6 <- diag(6), row = rep("",6), coll=rep("",6))

     chm <- matrix(scan(file.path(system.file(pkg = "eda"),
                                  "help", "AnIndex"),
                        what = ""), , 2, byrow = TRUE)
     chm  #-> print.default(.)  = `same' as  print.matrix(chm)
     print.matrix(chm, collab = paste("Column",1:3), right=TRUE, quote=FALSE)

