Skip to content
Prev 174761 / 398506 Next

Odp: error statement: missing value where TRUE/FALSE needed

Hi


r-help-bounces at r-project.org napsal dne 23.03.2009 15:38:49:
markov-switching
the
message
The error message means that there is missing value instead of logical 
when you are calling if
[1] NA
Error in if (a < b) print("No.way") : 
  missing value where TRUE/FALSE needed
[1] "No.way"

So test r and vQ if they contain missing values or change your code

Besides, it looks like code written in Basic not in R

Few other comments

* read.table() already produce data frame

* This is really strange, I did not see such construction yet
cbind(0,0,0,100))

what about
[,1] [,2] [,3] [,4]
[1,]  100    0    0    0
[2,]    0  100    0    0
[3,]    0    0  100    0
[4,]    0    0    0  100

* Better upgrade to 2.8.1, or maybe wait about a month for 2.9.0

* I do not think that somebody will go through whole your code, it is 
terribly complicated.

Regards
Petr
so
and
http://www.R-project.org/posting-guide.html