It's a rounding problem. All the output from summary(FTSE$LastPrice)
has only 4 significant digits. If you look at ?summary
in its Usage
section you see the default for digits (as a named argument) coupled with the default for digits as an option gets your to 4.
# summary(object, ..., digits = max(3, getOption("digits")-3))
> getOption("digits")
[1] 7
So try:
summary(FTSE$LastPrice, digits=7)
An unanswered question remains, however: Why does the summary.data.frame function not do the same degree of rounding, since the default argument to digits is the same for the .default
and the .data.frame
methods? Looking at the code you see that summary.data.frame actually first does summary.default
on its columns with a fixed value of digits=12L, and later uses the digits argument to format
. It seemed to me that the help page was somewhat obscure in this area in it arguments description
digits: integer, used for number formatting with signif() (for summary.default) or
format() (for summary.data.frame).
It completely ignores the fact that the default (and fixed) signif for data.frame columns is quite different.