To set limits before using scientific notation for large numbers, you can set the 'scipen' parameter within options(). The default limit is 10^12 for displaying in R console and 10^7 for the graphic device.
The below is larger than 10^13, and R reverts to using scientific notation.
By setting the option to scipen=15, the same number is retained in its natural form.
To round the figure to significant figures, you can use the below function.
For rounding figures, you can do the following.
round(12645.654) #rounds to integer
round(12645.654,digits=2) #rounds to second decimal place
To find ceiling (smallest integer large than the given number) of a figure, you can do the following.
To find ceiling (largest integer smaller than the given number) of a figure, you can do the following.
To find absolute figure, you can do the following.
To find the remainder of a division, you can use '%%', but this does not work well with large numbers
To find quotient of a division (integer part of division output), you can use '%/%'.