[R] printing a data.frame without row numbers

@vi@e@gross m@iii@g oii gm@ii@com @vi@e@gross m@iii@g oii gm@ii@com
Mon Mar 27 19:31:12 CEST 2023


Try:

print(data.frame(COL1=1:5, COL2=10:6), row.names=FALSE)



-----Original Message-----
From: R-help <r-help-bounces using r-project.org> On Behalf Of Dennis Fisher
Sent: Monday, March 27, 2023 1:05 PM
To: r-help using r-project.org
Subject: [R] printing a data.frame without row numbers

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.



More information about the R-help mailing list