[R] printing a data.frame without row numbers

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Mon Mar 27 19:34:12 CEST 2023


Read ?print.data.frame. There is an argument for that.

On March 27, 2023 10:05:10 AM PDT, Dennis Fisher <fisher using plessthan.com> wrote:
>R 4.2.3
>OS X
>
>Colleagues,
>
>I am printing a large number of tables using the print command.  A simple example is:
>	print(data.frame(COL1=1:5, COL2=10:6))
>
>The result in this case is:
>  COL1 COL2
>1    1   10
>2    2    9
>3    3    8
>4    4    7
>5    5    6
>
>I would like to print the table WITHOUT the row numbers:
> COL1 COL2
>    1   10
>    2    9
>    3    8
>    4    7
>    5    6
>
>Is there any simple way to accomplish this, short of writing my own print method or outputting line-by-line using cat?
>
>Dennis
>
>Dennis Fisher MD
>P < (The "P Less Than" Company)
>Phone / Fax: 1-866-PLessThan (1-866-753-7784)
>www.PLessThan.com
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list