Calculate Cumulative Product of a Numeric Object in R Programming – cumprod() Function Improve Improve Improve Like Article Like Save Article Save Share Report issue Report cumprod() function in R Language is used to calculate the cumulative product of the vector passed as argument. Syntax: cumprod(x) Parameters: x: Numeric Object Example 1: # R program to illustrate # the use of cumprod() Function # Calling cumprod() Function cumprod(1:4) cumprod(-1:-6) Output: [1] 1 2 6 24 [1] -1 2 -6 24 -120 720 Example 2: # R program to illustrate # the use of cumprod() Function # Creating Vectors x1 <- c(2, 4, 5, 7) x2 <- c(2.4, 5.6, 3.4) # Calling cumprod() Function cumprod(x1) cumprod(x2) Output: [1] 2 8 40 280 [1] 2.400 13.440 45.696 Last Updated : 05 Jun, 2020 Like Article Save Article Previous Check if a value or a logical expression is TRUE in R Programming - isTRUE() Function Next Count the Frequency of elements in a Numeric Vector - tabulate() Function Share your thoughts in the comments Add Your Comment Please Login to comment...