[R] error with summary(vector)??

Duncan Murdoch
Sun, 30 Aug 2009 21:59:31 -0000

On 30/08/2009 5:39 PM, 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) ??

Read ?summary.  The "digits" parameter is handled differently in your
two cases:

 > format(c(49.85, 70632), digits=4)
[1] "   49.85" "70632.00"

 > signif(c(49.85, 70632), digits=4)
[1]    49.85 70630.00


Duncan Murdoch