Is there a way to use the filtering function inside the summarise for example:
#I have a dataset with 5 columns Price, Type, Amount USD, date
# I only want the mean price of the rows that are not Type == "SELL"
data = summarise(Price = filter(!Type == "SELL") %>% mean(Price), Amount = sum(Amount), USD = sum(USD), date = min(date))