[R] output without labels and delimited by Tab
ben@zoo.ufl.edu
ben at zoo.ufl.edu
Tue Feb 27 04:24:19 CET 2001
Once you get to this level, the best reference is the language itself
-- just type
summary.data.frame
for a listing of the function code. (Luckily, this piece of R is written
in the R language and not in C or FORTRAN, so you don't have to go hunting
through source code.)
On Mon, 26 Feb 2001, Yu-Ling Wu wrote:
> Thank you very much! This is helpful!
> I'd like to know more about summary.data.frame but the
> R-language reference is not quite detailed. Where I
> can find a more detailed document about it?
>
> Thanks,
> Yu-Ling Wu
>
> --- ben at zoo.ufl.edu wrote:
> >
> > The main function driving the formatting here is
> > summary.data.frame().
> > You can hack this function to get the formatting you
> > want.
> >
> > Or (for a probably-quicker but less general
> > solution) you can just write
> > your own function with less complication than
> > summary.data.frame.
> >
> > mysum <- function(x) {
> > qq <- quantile(x,c(0.25,0.5,0.75))
> > c(min(x),qq[1:2],mean(x),qq[3],max(x))
> > }
> >
> >
> write.table(apply(x,2,mysum),sep="\t",quote=FALSE,row.names=FALSE)
> >
> > Does more or less what you want, although there is a
> > problem with the
> > column headers being shorter (and thus not tabbed
> > over as far) as the
> > columns. You could implement something with
> > blank-padding, keeping the
> > same number of significant digits for all the
> > numbers, etc., but
> > eventually you will find yourself rewriting
> > summary.data.frame() from
> > scratch.
> >
> > On Mon, 26 Feb 2001, Yu-Ling Wu wrote:
> >
> > > Hi,
> > >
> > > I have a set of data and when I run
> > "summary(data)", I
> > > got the following output:
> > >
> > > dstuser dstmethod numaction
> > > Min. : 0.000 Min. : 0.000 Min. : 0.00
> > > 1st Qu.: 1.000 1st Qu.: 1.000 1st Qu.: 2.00
> > > Median : 3.000 Median : 6.500 Median : 33.00
> > > Mean : 4.894 Mean : 6.565 Mean : 59.32
> > > 3rd Qu.: 9.000 3rd Qu.:11.000 3rd Qu.: 94.25
> > > Max. :25.000 Max. :19.000 Max. :317.00
> > >
> > > Question (1): How to make the output look like
> > this
> > > (get rid of the "labels")?
> > >
> > > dstuser dstmethod numaction
> > > 0.000 0.000 0.00
> > > 1.000 1.000 2.00
> > > 3.000 6.500 33.00
> > > 4.894 6.565 59.32
> > > 9.000 11.000 94.25
> > > 25.000 19.000 317.00
> > >
> > > Question (2): How to make each column delimited by
> > Tab
> > > instead of white spaces?
> > >
> > > Thanks,
> > > Yu-Ling Wu
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Get email at your own domain with Yahoo! Mail.
> > > http://personal.mail.yahoo.com/
> > >
> >
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> > > r-help mailing list -- Read
> > http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> > > Send "info", "help", or "[un]subscribe"
> > > (in the "body", not the subject !) To:
> > r-help-request at stat.math.ethz.ch
> > >
> >
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> > >
> >
> > --
> > 318 Carr Hall
> > bolker at zoo.ufl.edu
> > Zoology Department, University of Florida
> > http://www.zoo.ufl.edu/bolker
> > Box 118525 (ph)
> > 352-392-5697
> > Gainesville, FL 32611-8525 (fax)
> > 352-392-3704
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
--
318 Carr Hall bolker at zoo.ufl.edu
Zoology Department, University of Florida http://www.zoo.ufl.edu/bolker
Box 118525 (ph) 352-392-5697
Gainesville, FL 32611-8525 (fax) 352-392-3704
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list