Q:

Write a R program to find Sum, Mean and Product of a Vector

0

Write a R program to find Sum, Mean and Product of a Vector.

All Answers

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

x = c(10, 20, 30)
print("Sum:")
print(sum(x))
print("Mean:")
print(mean(x))  
print("Product:")
print(prod(x))

Sample Output:

[1] "Sum:"
[1] 60
[1] "Mean:"
[1] 20
[1] "Product:"
[1] 6000

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