Charilaos Skiadas ha scritto:
On May 9, 2008, at 5:39 AM, Dieter Menne wrote:

If I understand the OP's question properly, the first value is to be a multiple of 50, the second a multiple of 5, and the third a multiple of 1. This can be done with this slight variation on the above theme:

a <- c(1803.02, 193.51, 3.47)
b <- c(50,5,1)
round(a/b) *b

This is exactly was I was looking for, and you understand it properly.
Sorry for the double post, but I'm experiencing problems with my account in this list


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
No, even if there's a lab background working behind, I'm only transferring some experience with spreadsheets to R.

I want (actually "the pipette wants") 1800 instead that 1805 since the larger volumes are to be delivered with a digital pipette whose step is 50.

Thanks to all the people who contributed. This list is always a great source.

8rino

______________________________________________
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