powered by
Returns a numeric object whose elements are the cumulative sums of the elements of the argument.
cumsum(x, na.rm = FALSE)
a numeric object.
logical. Should missing values be removed? Default FALSE.
FALSE
If na.rm=TRUE, then NA are treated as 0 when computing the cumulative sum.
na.rm=TRUE
NA
0
# NOT RUN { x <- mtcars[1:5,] x[2,] <- NA cumsum(x) cumsum(x, na.rm = TRUE) # } # NOT RUN { # }
Run the code above in your browser using DataLab