[Solved] Subset and filter not giving proper answer


Since your column C1 is numeric, you should not use quotes. Try this:

 subset(KL, C1 > 300)

   ID      C1
1   A  597.69
3   C  601.30
4   D 4052.60
15  O  354.12

But note that you should use caution with subset() – this will not always do what you think it does.

It’s better to use [ for subsetting:

KL[KL$C1 > 300, ]
   ID      C1
1   A  597.69
3   C  601.30
4   D 4052.60
15  O  354.12

solved Subset and filter not giving proper answer