[R] Calculating with tolerances

Bernardo Rangel Tura tura at centroin.com.br
Thu Sep 9 10:58:35 CEST 2010


On Thu, 2010-09-09 at 09:16 +0430, Jan private wrote:
> Dear list,
> 
> I am from an engineering background, accustomed to work with tolerances.
> 
> For example, I have measured
> 
> Q = 0.15 +- 0.01 m^3/s
> H = 10 +- 0.1 m
> 
> and now I want to calculate
> 
> P = 5 * Q * H 
> 
> and get a value with a tolerance +-
> 
> What is the elegant way of doing this in R?
> 
> Thank you,
> 	Jan

Hi Jan,

If I understood  your problem this script solve your problem:

q<-0.15 + c(-.1,0,.1)
h<-10 + c(-.1,0,.1)
5*q*h
[1]  2.475  7.500 12.625

-- 
Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology
Brazil



More information about the R-help mailing list