cm <- cummax(c(3, 1, 2, 3, 4, 3, 2, 5, 4, 1)) cm # [1] 3 3 3 3 4 4 4 5 5 5 # See also -> cumsum
sum()
cumsum()
Index