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
+ }
+ }
+ if(orientation=="out"){
+ if(eff_p1[i,1,i]==1 && eff_p1[i,1,ti-1]>1 && ed[i,1]>d[i,1]){
+ roc[i,1]<-(eff_p1[i,1,ti-1])^(1/(ed[i,1]-d[i,1]))
+ n<-n+1
+ }
+ }
+ }
Error in if (eff_p1[i, 1, i] == 1 && eff_p1[i, 1, ti - 1] < 1 && ed[i, :
missing value where TRUE/FALSE needed
I checked "eff_p1[i,1,i]==1 && eff_p1[i,1,ti-1]<1 && ed[i,1]>d[i,1]" for
all i and it returned either TRUE or FALSE normally.
Why it shows error message when I link it with repetitive execution (for i
in 1:ti-1)?
All variables have been defined correctly including ti, orientation,
eff_p1, and ed.
Thanks in advance,
DJ
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.