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

2008-05-11 Thread Alberto Santini
Hello Luca. Dr. Ottorino-Luca Pantani wrote: ... 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

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

2008-05-09 Thread Dr. Ottorino-Luca Pantani
Dear R-users, I have the following problem 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

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

2008-05-09 Thread Dieter Menne
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

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

2008-05-09 Thread Charilaos Skiadas
On May 9, 2008, at 5:39 AM, Dieter Menne wrote: Dr. Ottorino-Luca Pantani ottorino-luca.pantani at unifi.it writes: 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,

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

2008-05-09 Thread Ottorino-Luca Pantani
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 -

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

2008-05-06 Thread Dr. Ottorino-Luca Pantani
Dear R-users, I have the following problem 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

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

2008-05-06 Thread Duncan Murdoch
On 5/6/2008 12:07 PM, Dr. Ottorino-Luca Pantani wrote: Dear R-users, I have the following problem 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

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

2008-05-06 Thread Yasir Kaheil
Hi Ottorino, You could just use the modulus operator %% as follows: x-c(1803.02, 193.51, 3.47); x-x%%c(50,5,1) #just using the modulus operator [1] 1800 1903 thanks Dr. Ottorino-Luca Pantani wrote: Dear R-users, I have the following problem In a lab experiment I have to mix three

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

2008-05-06 Thread hadley wickham
I believe this function matches the description in OOO: mround - function(number, multiple) multiple * round(number/multiple) I've implemented a slightly more general form in the reshape package: round_any - function (x, accuracy, f = round) { f(x/accuracy) * accuracy } Hadley --