R basically does some basic configuration to print the number of digits required. You can change this with the digits option as follows:
> options(digits=9) > y <- as.character("0.912345678") > as.numeric(y) [1] 0.912345678
A small EDIT for clarity: digits matches the number of digits to display everything , not just the number of digits after the decimal point.
For instance,
> options(digits=9) > y <- as.character("10.123456789") > as.numeric(y) [1] 10.1234568
In your example, above the leading zero before the decimal point is not taken into account, so 9 digits were enough to display the full number.
source share