I want a function to return the product of all the values in a vector, like sum but with multiplication instead of addition. I expected this to exist already, b
sum
If your data is all greater than zero this is a safer solution that will not cause compute overflows:
exp(sum(log(x)))
You want prod:
prod
R> prod(1:3) [1] 6