If I have a vector of numbers in R.
numbers <- c(1,1, 2,2,2, 3,3, 4,4,4,4, 1)
I want to return a vector that provides the number of times this value happened cumulatively along the vector. I.e.
results <- c(1,2, 1,2,3, 1,2, 1,2,3,4, 3)
falcs source
share