[R] Error: argument is of length zero

Derek Lacoursiere Derek.Lacoursiere at ufv.ca
Fri May 29 00:39:23 CEST 2009


Hi,

I have the following:

	for(j in (y.raw+1):(rownum-1)){
		valsum<-tstfframed[min.x,j]+tstfframed[min.x,j+1]
		if(valsum == 1){
			cat("valsum loop")
			int.num<-int.num+1
		}
		
	}

but I get the error message: "Error in if (valsum == 1) { : argument is of length zero".  I checked whether to see if all the stated variables have associated values (and are not NAs) and every variable (even valsum!) has a value.  I have no idea where my error is. Can you help me?




More information about the R-help mailing list