on 06/19/2008 09:59 AM Gundala Viswanath wrote:
Hi,
I have the following dataset (simplified for example).
__DATA__
300.35 200.25 104.30
22.00 31.12 89.99
444.50 22.10 43.00
22.10 200.55 66.77
Now from that I wish to do the following:
1. Compute variance of each row
2. Pick top-2 row with hi
Dear Gundala,
Try this:
# Data set
DF=read.table(textConnection("300.35 200.25 104.30
22.00 31.12 89.99
444.50 22.10 43.00
22.10 200.55 66.77"),header=FALSE,sep="")
# Variances
VAR=apply(DF,1,var)
# Order
pos=order(VAR)
# Print VAR and pos
VAR
pos
# ordered VAR
VAR[pos]
# top-2 highest VAR
Hi,
I have the following dataset (simplified for example).
__DATA__
300.35 200.25 104.30
22.00 31.12 89.99
444.50 22.10 43.00
22.10 200.55 66.77
Now from that I wish to do the following:
1. Compute variance of each row
2. Pick top-2 row with highest variance
3. Store those selected rows for fu
3 matches
Mail list logo