[R] Is there in R a function equivalent to the mround, as found in most spreadsheets?

Dieter Menne dieter.menne at menne-biomed.de
Fri May 9 11:39:17 CEST 2008


Dr. Ottorino-Luca Pantani <ottorino-luca.pantani <at> unifi.it> writes:

> 
> In a lab experiment I have to mix three solutions to get different 
> concentrations of various molecules in a cuvette
> 
> I've used R to calculate the necessary µliters for each of the level of 
> the experiment and I must confess that it is more useful and easier to 
> achieve the results than using spreadsheets.
> 
> But there's a problem.
> 
> Imagine that for a particular cuvette (I have 112 different cuvettes !!) 
> you have to mix the following volumes of solution A, B, and C respectively.
> 
> c(1803.02, 193.51, 3.47)
> 
> Each solution is to be taken with 3 different pipettes (5000, 250 and 10 
> µL Volume max) and each of those delivers volumes in steps of 50 µL,  5 
> µL  or 1µL, respectively
> Since the above values  would eventually become
> 
> c(1800, 195, 3)
> 
> it is then necessary to recalculate all the final concentrations
> of A, B and C, because the volumes are changed.

A first guess would be

a = c(1803.02, 193.51, 3.47)
round(a / 5)*5

which gives

1805  195    5

This is not exactly what you want, but it shows that the problem is a bit
ill-defined. In the example you gave, why do you want 1800, and not 1805, which
is possible with the pipettes? I assume that you laboratory experience is
working in the background, telling you to stop pipetmanning when you are close
to the result in some "percentage" feeling.

Dieter



More information about the R-help mailing list