Skip to content
Back to formatted view

Raw Message

Message-ID: <1318873152771-3912767.post@n4.nabble.com>
Date: 2011-10-17T17:39:12Z
From: 1Rnwb
Subject: calculating ratios from all combinations
In-Reply-To: <1318869450121-3912608.post@n4.nabble.com>

so here is the code I need help to fix the line for 'st' when it reaches
maximum, that's where i am getting stuck.

thanks
Sharad
set.seed(100)
 d=data.frame(x=rnorm(20)+5,
 x1=rnorm(20)+5,
 x2=rnorm(20)+5,
 x3=rnorm(20)+5,
 x4=rnorm(20)+5,
 x5=rnorm(20)+5,
 x6=rnorm(20)+5,
 x7=rnorm(20)+5,
 x8=rnorm(20)+5)
 r2=c()
 cinit=0
 for (col in 1:9)
 {
  cinit=cinit+1
  st=cinit+1
  end=dim(d)[2]
  r=d[,cinit]-d[,st:end]
  r2=cbind(r2,r)
 }

--
View this message in context: http://r.789695.n4.nabble.com/calculating-ratios-from-all-combinations-tp3912560p3912767.html
Sent from the R help mailing list archive at Nabble.com.