Не мисля, че това ще бъде възможно за общо показване в R. ?options
казва това за цифрите:
‘digits’: controls the number of digits to print when printing
numeric values. It is a suggestion only. Valid values are
1...22 with default 7. See the note in ‘print.default’ about
values greater than 15.
Ключовата фраза е „Това е само предложение“.
След това имайте предвид, че това, което се отпечатва, първоначално се управлява от приложения print()
метод (това е скрито по време на интерактивна употреба, защото R auto-print()
s). За подробности вижте ?print
и ?print.default
за основните методи. От ?print.default
отбелязваме
digits: a non-null value for ‘digits’ specifies the minimum number of
significant digits to be printed in values. The default,
‘NULL’, uses ‘getOption(digits)’. (For the interpretation
for complex numbers see ‘signif’.) Non-integer values will
be rounded down, and only values greater than or equal to 1
and no greater than 22 are accepted.
и в секцията Подробности имаме:
The same number of decimal places is used throughout a vector.
This means that ‘digits’ specifies the minimum number of
significant digits to be used, and that at least one entry will be
encoded with that minimum number. However, if all the encoded
elements then have trailing zeroes, the number of decimal places
is reduced until at least one element has a non-zero final digit.
Decimal points are only included if at least one decimal place is
selected.
По подразбиране за digits
е NULL
, което показва, че се използва getOption("digits")
, но както вече отбелязахме, това е само ръководство.
Изглежда, че няма начин да конфигурирате R да прави това, което искате, нито да го правите глобално. Ще трябва да пренапишете print.default()
или всички print()
методи, които трябва да използвате, и да накарате тези версии да се използват вместо стандартните версии --- сега не е лесно с NAMESPACES.
person
Gavin Simpson
schedule
10.06.2012
lun
като0.000000
? - person Gavin Simpson   schedule 10.06.2012