I do not want to see any scientific notation in any result of any calculation in my R session. I want to see all the actual numbers, preferably with a comma (,) after every three digits.
How can I do that? options(scipen = 999)
does not cut it.
I do not want to see any scientific notation in any result of any calculation in my R session. I want to see all the actual numbers, preferably with a comma (,) after every three digits.
How can I do that? options(scipen = 999)
does not cut it.
The
print.default
function looks at theoptions()['digits']
value in "deciding" what width to allocate, so you may need to increase it as well as trying to max out 'scipen'. There are OS specific issues with values above 16 for that width. As for the commas request, ... forget it. R is not a financial reporting system. If you need to force this output format, you can define objects to be of a particular class and write print methods for them using sprintf and formatC, Or I suppose you can rewrite print.default, but that might only affect printing operations that were not passed to one of the other 100+ methods forprint
.There are output methods.
formatC()
andprettyNum()
both have a 'big.mark' argument that will insert commas into numbers. The output is in"character"
format, so do not try to do any further calculations on the results you create.There are also input methods that could read columns with numbers containing commas or currency symbols: