[R] printing a data.frame without row numbers

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Mon Mar 27 19:29:15 CEST 2023


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


On 27/03/2023 1:05 p.m., Dennis Fisher 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.



More information about the R-help mailing list