I have this dataframe of 4 columns and I want to delete those rows which are not less than equal to difference of 100 to col_A
User Col_A Col_B Col_C
a 1450 1450 1250
b 1450 1450 1440
c 1320 1280 1225
d 1300 1300 1190
e 1295 1250 1200
f 1295 1295 1250
g 1295 1240 1000
h 1295 1295 1260
j 1295 1295 1260
k 1295 1295 1260
l 1295 1295 1190
m 1295 1295 1260
n 1250 1250 1220
o 1200 1200 1160
p 1180 1180 1070
q 1030 1030 990
I want to retain only those rows based on data in Column_C in my dataframe which are less then equal to difference of 100 to Column_A
User Col_A Col_B Col_C
b 1450 1450 1440
c 1320 1280 1225
e 1295 1250 1200
f 1295 1295 1250
h 1295 1295 1260
j 1295 1295 1260
k 1295 1295 1260
m 1295 1295 1260
n 1250 1250 1220
o 1200 1200 1160
q 1030 1030 990
I am trying to work with following code to filter the rows but unable to get the desired output.
df<- filter(df, Col_C<=Col_A & Col_C>=Col_A-100)
Thanks in advance.