R

Asked • 09/20/19

Geometric Mean: is there a built-in?

I tried to find a built-in for geometric mean but couldn't.(Obviously a built-in isn't going to save me any time while working in the shell, nor do I suspect there's any difference in accuracy; for scripts I try to use built-ins as often as possible, where the (cumulative) performance gain is often noticeable.In case there isn't one (which I doubt is the case) here's mine. gm_mean = function(a){prod(a)^(1/length(a))}

1 Expert Answer

By:

David B. answered • 05/22/21

Tutor
5.0 (257)

Math and Statistics need not be scary

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.