Q:

Write a R program to find the maximum and the minimum value of a given vector

0

Write a R program to find the maximum and the minimum value of a given vector.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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)))

Sample Output:

[1] "Original vector:"
[1] 10 20 30 40 50 60
[1] "Maximum value of the said vector: 60"
[1] "Minimum value of the said vector: 10"

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now