I have a dataset and I'm trying to sum the values of transactions given a value in another column being greater than a specified list of thresholds. I'm not trying to sum the values in between these thresholds, just the value of the amount above them.
I.e. for the dataset given a particular market, I'd like to sum the value of transactions greater than each threshold for yield.
Here is what I have but the result is unfortunately just summing the quantities between the bin values:
data5 <- data %>%
group_by(market,zip,yield2 = cut(yield, breaks = seq(0.04,.06,by=0.0025))) %>%
summarise("Total Transaction Value" = sum(Value))
question from:
https://stackoverflow.com/questions/65854663/sum-by-conditional-value-greater-than-not-by-bin-widths 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…