[R] error with summary(vector)??

Oliver Kullmann O.Kullmann at swansea.ac.uk
Mon Aug 31 07:06:10 CEST 2009


Ah, thank you! (A bit strange.)

Now looking more closer to it, I wonder whether I could achieve
the following output formatting:

> fivenum(E$nodes,1)
[1]     1     2     3     7 70632
> round(mean(E$nodes),2)
[1] 49.85

That's a reasonable way of showing the numbers involved, since
E$nodes is declared as integer data.

Now could I get "summary" to show me the numbers in this way, i.e.
     Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
     1     2         3          49.85     7       70630

?? I guess not. Perhaps it would be helpful to see how "summary"
achieves its result here --- how to display the code of this
function? (Spent some time with the documentation and on the
Internet, but can't find the right combination of key words,
and a nice section "List everything related to functions" doesn't
seem to be available.)

Thanks for your help.

Oliver


On Sun, Aug 30, 2009 at 10:39:48PM +0100, Oliver Kullmann wrote:
> Hello,
> 
> I get
> 
> > summary(E)
>      level             nodes            ave_nodes            time
>  Min.   :      1   Min.   :    1.00   Min.   :  10.71   Min.   :  0.0000
>  1st Qu.: 237414   1st Qu.:    2.00   1st Qu.:  19.70   1st Qu.:  0.0100
>  Median : 749229   Median :    3.00   Median :  27.01   Median :  0.0100
>  Mean   : 767902   Mean   :   49.85   Mean   :  98.89   Mean   :  0.2296
>  3rd Qu.:1111288   3rd Qu.:    7.00   3rd Qu.:  80.38   3rd Qu.:  0.0300
>  Max.   :2097152   Max.   :70632.00   Max.   :4451.67   Max.   :338.9200
>     ave_time          singles    autarkies     depth    ave_reductions
>  Min.   : 0.0490   Min.   :0   Min.   :0   Min.   :33   Min.   : 0.20
>  1st Qu.: 0.0910   1st Qu.:0   1st Qu.:0   1st Qu.:52   1st Qu.: 7.50
>  Median : 0.1270   Median :0   Median :0   Median :52   Median : 9.92
>  Mean   : 0.4636   Mean   :0   Mean   :0   Mean   :52   Mean   :11.76
>  3rd Qu.: 0.3860   3rd Qu.:0   3rd Qu.:0   3rd Qu.:52   3rd Qu.:13.46
>  Max.   :16.2720   Max.   :0   Max.   :0   Max.   :52   Max.   :70.00
> > summary(E$nodes)
>     Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
>     1.00     2.00     3.00    49.85     7.00 70630.00
> 
> The max-value for E$nodes is incorrect --- it it 70632, as computed by
> summary(E) ??
> 
> Oliver
> 
> ______________________________________________
> R-help at r-project.org mailing list
> 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