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 ______________________________________________ R-help@r-project.org 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.