[R] Wondering why I get a NULL output for this if condition!

Aditya Singh aps6dl at yahoo.com
Fri Nov 21 19:19:01 CET 2014


1 my_min= min(outcome_data[which(outcome_data$State==my_state),11],na.rm=TRUE) 
2 print(my_min) 
3 jkr=0 
4 if (jkr<= 4706) {jkr=jkr+1 
5 if (identical(outcome_data[jkr,11],my_min) && identical(outcome_data[jkr,7],my_state)) { 
6 print((outcome_data[jkr,2])) 
7 break 
8 } 


Dear Experts,

My computer is never 'inside' of  the if condition at line 5, as jkr=0 always. my_min is a numeric. my_state is a 2 letter American State (character).

This code gives NULL as output. Wondering!

Its either very obvious or I am very dumb.

Please do do reply!

Aditya



More information about the R-help mailing list