Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
If I have the following vector
c(5,3,2,6,7,8,1)
I want to get minimum vector
c(5,3,2,2,2,2,1)
Any idea how to achieve this?