Social Media Research

02 R Data Analysis


Question

What is cumulative summing? What will be the output of the following code: cumsum(1:3)


Answer

for cumulative summation, the first value is output and then added to the subsequent one. The result is then added to the next value. In this specific case:

> cumsum(1:3)
[1] 1 3 6



Comments