Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
206 views
in Technique[技术] by (71.8m points)

r - Sum by Conditional Value Greater than Not by Bin Widths

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...