[R] What is the correct syntax of "for" or "if" in Rexcel

2012-03-20 Thread Dong-Joon Lim
Hello thankful R friends, Can I use iteration (for) or conditional (if) syntax in rexcel using rrun? I've finished coding my program and want to run through Excel. I just want to run such as Call rinterface.RRun("for(i in 1:10){") Call rinterface.RRun("a[i,1]<-i") Call rinterface.RRun("}") But i

[R] How to use R script in VB?

2012-03-18 Thread Dong-Joon Lim
Hello R friends, I want to use my R script in VB to make macro in Excel. I tried with RExcel but it seems to me that this package is just GUI API and I still have to run(connect) R to use the script. Google tells me there are some ways to make R script as an independent library/module/header so th

Re: [R] Error in conditional execution "missing value where TRUE/FALSE needed"

2012-03-18 Thread Dong-Joon Lim
1:(3-1) #Not equal > > If that doesn't fix it, you can use options(error = recover) to find > the values of your logical conditions at the exact moment an error is > thrown and see which one is NA but my money is on the above. > > Michael > > > On Sat, Mar 1

[R] Error in conditional execution "missing value where TRUE/FALSE needed"

2012-03-17 Thread Dong-Joon Lim
Hello R friends, I've got error message as follows; > > n<-0 > roc<-array(0,c(ti-1,1)) > avgroc<-0 > > for(i in 1:ti-1){ + if(orientation=="in"){ + if(eff_p1[i,1,i]==1 && eff_p1[i,1,ti-1]<1 && ed[i,1]>d[i,1]){ + roc[i,1]<-(1/eff_p1[i,1,ti-1])^(1/(ed[i,1]-d[i,1])) + n<-n+1 + } + }