frac {cwhmath} | R Documentation |
Split off fractional part of a number
frac(x,d)
x |
Numerical vector. |
d |
If not missing, determines number of decimals after "." |
fractional part, if d
is missing; else
round(10^d*fractional part), i.e. the digits without the leading "0.".
d
not missing is practical for use in dc
Christian W. Hoffmann, christian.hoffmann@wsl.ch,
http://www.wsl.ch/staff/christian.hoffmann
frac(c(0,pi,2*pi,30*pi)) # 0.000000 0.141593 0.283185 0.247780 frac(c(0,pi,2*pi,30*pi),3) # 0 142 283 248