Use code as below
dataframe[which(dataframe$sales >= median(dataframe$sales)),]
or dataframe[dataframe$sales >= median(dataframe$sales),]
When you want to use condition to fetch rows from the data frame, use wither which() or provide the condition
A small trick is to change the condition to its negation and then filter when you cant use condition directly inside the data frame and add inside which().