[R] print of objects in R

Paul Hiemstra p.hiemstra at geo.uu.nl
Fri Mar 20 12:46:58 CET 2009


Hi Mary,

To print without [1,] use cat() instead of print(). To get rid of the 
row names when printing a data.frame use:

print(data.frame, row.names = FALSE)

To get nice Latex tables, you can use xtable (as the other reply 
suggested). If you want to include it in Word, you can export your data 
using write.table and read it into Excel to make a table for Word.

cheers,
Paul

Mary A. Marion wrote:
> Hello,
>
> I have been watching my output as I create functions and do other 
> things in r.
> One thing I don't like is the [1,] type notation at the beginning of a 
> line.  I have been
> able to change that to a number such as 1 2 etc.   using 
> as.data.frame(object).
>
> How can I stop the printing of a line number and column heading if I 
> want to?
> I am thinking about publishing and writing of papers.  It is much 
> easier to not have to
> remove that leading line number when inserting output into papers.
>
> Thank you.
>
> Sincerely,
> mmstat
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:  +3130 274 3113 Mon-Tue
Phone:  +3130 253 5773 Wed-Fri
http://intamap.geo.uu.nl/~paul




More information about the R-help mailing list