当超过阈值时,如何使用cumsum返回索引?
v <- c(1,5,7,9,10,14,16,17) Threshold <- 10
该函数将返回3,因为累积和将仅大于10,这提供了e索引3作为结果.
r dataframe cumsum
cumsum ×1
dataframe ×1
r ×1