Skip to content
Prev 174294 / 398506 Next

print of objects in R

xtable in the library xtable does a good job if you are using latex to
write up your results.  For example:
% latex table generated in R 2.8.0 by xtable 1.5-4 package
% Fri Mar 20 13:48:53 2009
\begin{table}[ht]
\begin{center}
\begin{tabular}{rrrrrr}
  \hline
 & 1 & 2 & 3 & 4 & 5 \\
  \hline
1 & -0.45 & 0.25 & -0.42 & -1.64 & -0.45 \\
  2 & 1.39 & 0.06 & 0.08 & 2.12 & 1.39 \\
  3 & 0.49 & -0.78 & -1.28 & -0.45 & 0.49 \\
  4 & -0.11 & -0.81 & 1.48 & 0.30 & -0.11 \\
  5 & 0.12 & -0.11 & -0.14 & 1.50 & 0.12 \\
   \hline
\end{tabular}
\end{center}
\end{table}

Or you could roll your own using for loops and the print function if
this format isn't what you want.

HTH,

Andrew.
On Mar 20, 12:48?pm, "Mary A. Marion" <mms... at comcast.net> wrote: