Uwe Ligges-3 wrote: > > > > Tom La Bone wrote: >> I have a measurement of 8165.666 and an uncertainty of 338.9741 (the >> units of >> both are unimportant). I can easily round the uncertainty to two >> significant >> digits with signif(338.9741,2), which gives 340. Is there a function in R >> that will take 8165.666 and round it to be consistent with its >> uncertainty, >> i.e., 8170? > > That's not consistent, you have 3 significant digits here, but 2 for the > "uncertainty" (whatever that is) ... > > Uwe Ligges > > >> >> Tom > > In metrology, what I did is indeed consistent (provided that I have > correctly interpreted the guidance given in the "ISO Guide to the > Expression of Uncertainty in Measurement"). The uncertainty is basically a > way of specifying in which digits I begin to doubt my result. So, I while > I will usually have two digits in my uncertainty, I can have 10 > significant digits in my result. Some folks have given me some ideas > off-line on how to write a function that will round a number in this > fashion, but I always prefer to use an existing R function if it already > exists rather than write my own. And, with the tens of thousands of R > functions in existence, it is always a good idea to ask the forum if they > know of one. > > Tom > > > > > > ______________________________________________ > 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. > >
-- View this message in context: http://n4.nabble.com/Rounding-a-Measurement-to-be-Consistent-with-its-Uncertainty-tp948151p949395.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.