Re: [R] how to print a data.frame without row.names

From: Heinz Tuechler <tuechler_at_gmx.at>
Date: Wed 03 Aug 2005 - 07:59:32 EST

Thanks to all of you for your help.

As far as I see, the solution of Peter Dalgaard works exactly as I want. All other solutions have limitations.

Heinz

At 19:19 02.08.2005 +0200, Peter Dalgaard wrote:
>Martin Maechler <maechler@stat.math.ethz.ch> writes:
>
>> >>>>> "Heinz" == Heinz Tuechler <tuechler@gmx.at>
>> >>>>> on Tue, 02 Aug 2005 17:46:07 +0200 writes:
>>
>> .......................
>>
>> Heinz> I tried this, but then the column headers and column
>> Heinz> contents are not aligned.
>>
>> ........................
>>
>> Use the tabulator if you need them aligned :
>>
>> write.table(USArrests, row.names = FALSE, sep = "\t")
>
>Unless a column or a header is 8 chars or wider (and UrbanPop is!).
>
>This seems to do it:
>
> x <- as.matrix(format(USArrests))
> rownames(x) <- rep("", nrow(x))
> print(x, quote=FALSE, right=TRUE)
>
>--
> O__ ---- Peter Dalgaard ุster Farimagsgade 5, Entr.B
> c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
> (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
>~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Aug 03 08:01:56 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:02:10 EST