[R] Defining array for nested for.loop.

2014-02-16 Thread Mathew Nagendran
Hey guys. The idea is I want to create a nested for.loop using pick.a values and m.control and m.sham at trunc1 to trunc6. How would I go about defining an array for this? I am unsure about what to put into length( ). In my last assignment it was a little bit more straightforward since I had:

Re: [R] Defining function help

2014-02-01 Thread Mathew Nagendran
ah, I see! Thanks you for the assistance! I can see how I went wrong. From: arun Sent: Friday, January 31, 2014 2:59 PM To: r-help@r-project.org Cc: Mathew Nagendran Subject: Re: [R] Defining function help Hi, Not sure if this is what you wanted

[R] Defining function help

2014-01-31 Thread Mathew Nagendran
Hello everyone. I am quite new to R and I would appreciate some help in figuring out what I am doing wrong. For the following code: > #with cost > > 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){(1-exp(-a*m)*(1-(1/30)*m))} > t.

[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

[R] For Loop Help

2014-01-05 Thread Mathew Nagendran
I'm relatively new to R. I'm trying to for loop but I keep getting an error message. Can anyone hint at what I am doing wrong please? > 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=function(m, a){(1-exp(-a*m))} #t function defined > > d=function(ts,