On Wed, 23-Jun-2004 at 07:29PM +0100, Dan Bolser wrote:

|> 
|> Hi,
|> 
|> I have data like this....
|> 
|> print(x)
|> 
|> ID   VAL1    VAL2
|> 1    2       6
|> 2    4       9
|> 3    45      12
|> 4    99      44
|> 
|> What I would like is data like this...
|> 
|> ID   VAL1    VAL2
|> 1    2       6
|> 2    4       9
|> 3    12      45
|> 4    44      99
|> 
|> 
|> So that my analysis of the ratio VAL2/VAL1 is somehow uniform.

By "uniform", I'm guessing you want them to be >= 1

If z is a vector of VAL2/VAL1 values, you can make them all >= 1 this way.

z[z < 1] <- z[z < 1]^-1

Depending on just how you want to use them, there could be better ways
but I've done enough guessing for now.

HTH

-- 
Patrick Connolly
HortResearch
Mt Albert
Auckland
New Zealand 
Ph: +64-9 815 4200 x 7188
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~
I have the world`s largest collection of seashells. I keep it on all
the beaches of the world ... Perhaps you`ve seen it.  ---Steven Wright 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to