I have a string that contains a number and when I convert it to a number I loose precision and I would like to know if there is a way to avoid that. Here is my example:
p <- "1087.003489" as.numeric(p, digits=6) R gives me 1087.003: > p <- "1087.003489" > as.numeric(p, digits=6) [1] 1087.003 I would be nice if I could keep all the decimal places after the conversion. Thanks, Roger *************************************************************** This message and any attachments are for the intended recipient's use only. This message may contain confidential, proprietary or legally privileged information. No right to confidential or privileged treatment of this message is waived or lost by an error in transmission. If you have received this message in error, please immediately notify the sender by e-mail, delete the message, any attachments and all copies from your system and destroy any hard copies. You must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message or any attachments if you are not the intended recipient. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.