Displaying 1 result from an estimated 1 matches for "moolman".
2018 Mar 31
4
R help
...you please provide help with something from R that I find rather
puzzling? In the small program below x[1]=1, . . . , x[5]=5. R also
finds that x[1]<=5 is TRUE. Yet when you attempt to execute while, R does
not seem to recognize the condition. Any thoughts on why this happens?
Regards
Henri Moolman
> x=c(1,2,3,4,5)
> x[1]
[1] 1
> i=1
> x[1]<=5
[1] TRUE
> while(x[i]<=5){
+ i=i+1
+ }
Error in while (x[i] <= 5) { : missing value where TRUE/FALSE needed
[[alternative HTML version deleted]]