Re: [R] Nested for loop help please.

2014-01-12 Thread arun
pick.a[count],pick.d[count1]))         tc1=sum(t.control(m.control,pick.a[count]))         output=c(output,ts1/tc1)     } } m1=matrix(output,200,100) print(m1) From: arun Sent: Saturday, January 11, 2014 6:00 PM To: Mathew Nagendran Subject: Re: [R] Nested for loo

Re: [R] Nested for loop help please.

2014-01-11 Thread arun
Hi, I guess you need to replace t() with t.control() or t.sham() output <-vector() for(count in 1:length(pick.a)){  for(count1 in 1:length(pick.d)){  ts1 = sum(t.sham(m.sham,pick.a[count],pick.d[count1])) tc1 <- sum(t.control(m.control,pick.a[count])) output= c(output,ts1/tc1)  }  } m1 <- matri

Re: [R] Nested for loop help please.

2014-01-11 Thread William Dunlap
r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Mathew Nagendran > Sent: Saturday, January 11, 2014 10:46 AM > To: r-help@r-project.org > Subject: [R] Nested for loop help please. > > Hi all I am relatively new to R. I am trying to crea

Re: [R] Nested for loop help please.

2014-01-11 Thread Rui Barradas
Hello, You are using the function ?t(), matrix transpose, with more than one argument. What is that supposed to do? The error message says that the other two arguments are not used (because they are illegal). And you don't need to transpose a vector to sum its components. Hope this helps, R

[R] Nested for loop help please.

2014-01-11 Thread Mathew Nagendran
Hi all I am relatively new to R. I am trying to create a nested for loop but i keep getting an error message (unused argument). Can someone help me find out where I am goign wrong? > m.control=c(1.45,9.40,9.96,4.2,1.86,0.2) > m.sham=c(3.39,23.94,23.62,10.08,2.99,1.09) > > t.control=function(m, a