0

I need to filter data1(data frame) based on Ave_redemption_hours less than 10. Below code works

data2 <- data1[data1$Avg_redemption_hours < 10,] 

I want to assign a value to num and var, and using these to fileter data1, but data2 return no values.

num=10
var = quote(Avg_redemption_hours)
data2=data1[noquote(paste('data1',var,sep="$")) >num ,]

Does anyone know what the issue here and how to resolve this?

Best regards,

Ken

Ken
  • 1
  • 1

0 Answers0