R Programming: Find the maximum and the minimum value of a given vector
R Programming: Basic Exercise-10 with Solution
Write a R program to find the maximum and the minimum value of a given vector.
Sample Solution :
R Programming Code :
nums = c(10, 20, 30, 40, 50, 60) print('Original vector:') print(nums) print(paste("Maximum value of the said vector:",max(nums))) print(paste("Minimum value of the said vector:",min(nums)))
 "Original vector:"  10 20 30 40 50 60  "Maximum value of the said vector: 60"  "Minimum value of the said vector: 10"
R Programming Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Test your Python skills with w3resource's quiz
What is the difficulty level of this exercise?
- New Content published on w3resource:
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework