The option "digits=2" makes sure that the output of each columns contains at least two significant digits. In the example above the last entry of Lower
is 0.0013, with two significant (non-zero) digits.
As an example, we can modify the option to digits=3:
> print(tbl,digits=3)
# Quant Lower Upper
#1 0.0 0.50000 0.500
#2 0.5 0.30854 0.691
#3 1.0 0.15866 0.841
#4 1.5 0.06681 0.933
#5 2.0 0.02275 0.977
#6 2.5 0.00621 0.994
#7 3.0 0.00135 0.999
Note that Lower
in row 7 now has three significant digits. The other entries in that column are adapted accordingly.
If want to have an output that contains not more than two decimal digits for any number in the table, irrespective of the significance of the digits, you could use the round()
function:
> round(tbl, digits=2)
# Quant Lower Upper
#1 0.0 0.50 0.50
#2 0.5 0.31 0.69
#3 1.0 0.16 0.84
#4 1.5 0.07 0.93
#5 2.0 0.02 0.98
#6 2.5 0.01 0.99
#7 3.0 0.00 1.00