revsum | R Documentation |
revsum generates a vector of the cumulative sum of an input vector from n to 1 rather than from 1 - n, as in cumsum.
revsum(x)
x |
an input vector |
a vector of cumulative values from n to 2
x <- c(1,2,3,4,5)/15
print(round(cbind(x,cumsum(x),revsum(x)),3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.