Hello,

As for truncation, you can write a one line function:

dec_trunc <- function(x, digits = 0) trunc(x * 10^digits)/10^digits


As for approximation, maybe you're looking for ?signif.

Hope this helps,

Rui Barradas

Em 17-07-2013 18:41, Francesco Miranda escreveu:
What is the function to do the truncation to a certain decimal digit of a 
number. And the function approximation?                                       
Thanks.
Francesco M                                     
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to