cummin() function in R Language is used to calculate the cumulative minima of the values of vector passed as arguments.
Syntax: cummin(x)
Parameters:
x: numeric object
Example 1:
# R program to cumulative minima # Calling cummin() function cummin(2:6) cummin(-2:-6) cummin(1.8:4.2) |
chevron_right
filter_none
Output:
[1] 2 2 2 2 2 [1] -2 -3 -4 -5 -6 [1] 1.8 1.8 1.8
Example 2:
# R program to cumulative minima # Creating vectors x1 <- c(3, 6, 4, 2, 6, 7) x2 <- c(-4, 6, 3) # Calling cummin() function cummin(x1) cummin(x2) |
chevron_right
filter_none
Output:
[1] 3 3 3 2 2 2 [1] -4 -4 -4
Since, the minima is calculated for the values in increasing order and hence the above code shows two cumulative values for first vector.
Recommended Posts:
- Calculate the Cumulative Maxima of a Vector in R Programming - cummax() Function
- Calculate Cumulative Product of a Numeric Object in R Programming – cumprod() Function
- Calculate Cumulative Sum of a Numeric Object in R Programming - cumsum() Function
- Compute the Value of Empirical Cumulative Distribution Function in R Programming - ecdf() Function
- Compute the value of F Cumulative Distribution Function in R Programming - pf() Function
- Compute the Parallel Minima and Maxima between Vectors in R Programming - pmin() and pmax() Functions
- Perform the Probability Cumulative Density Analysis on t-Distribution in R Programming - pt() Function
- Perform the Inverse Probability Cumulative Density Analysis on t-Distribution in R Programming - qt() Function
- Compute Cumulative Chi Square Density in R Programming - pchisq() Function
- Compute Cumulative Cauchy Density in R Programming - pcauchy() Function
- Compute Cumulative Logistic Density in R Programming - plogis() Function
- Compute Cumulative Log Normal Probability Density in R Programming - plnorm() Function
- Compute the Negative Binomial Cumulative Density in R Programming - pnbinom() Function
- Compute the Cumulative Poisson Density in R Programming - ppois() Function
- Compute the Value of Cumulative Weibull Density in R Programming - pweibull() Function
- Convert an Object into a Vector in R Programming - as.vector() Function
- Check for the Existence of a Vector Object in R Programming - is.vector() Function
- Create a Vector of Colors from a Vector of Gray Levels in R Programming - gray() or grey() Function
- Calculate the difference between Consecutive pair of Elements of a Vector in R Programming - diff() Function
- Calculate Median of elements of a Vector in R Programming - median() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

