【发布时间】:2020-12-18 02:12:06
【问题描述】:
有没有办法在summary中使用过滤功能,例如:
#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))
【问题讨论】: