I am checking if Minvalue is less than or equal the threshold value , if it satisifies the condition then returns TRUE else False .
sample data
finaldf3:
MinValue|threshold
9.264539|10.30201 |
10.03875|10.24155 |
10.20306|10.24155 |
9.064350|10.24155 |
10.38772|10.24155 |
I am using ifelse to do this.
Code :
finaldf3$check<-ifelse(as.character(finaldf3$MinValue)<=as.character(finaldf3$threshold),'TRUE','FALSE')
Actual results :
MinValue|threshold|check
9.264539|10.30201 |FALSE
10.03875|10.24155 |TRUE
10.20306|10.24155 |TRUE
9.064350|10.24155 |FALSE
10.38772|10.24155 |FALSE
Expected results:
MinValue|threshold|check
9.264539|10.30201 |TRUE
10.03875|10.24155 |TRUE
10.20306|10.24155 |TRUE
9.064350|10.24155 |TRUE
10.38772|10.24155 |FALSE