1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Writing Functions in R

Connected

Exercise

Passing arguments with ...

Rather than explicitly giving calc_harmonic_mean() and na.rm argument, you can use ... to simply "pass other arguments" to mean().

The dplyr package is loaded.

Instructions 1/2

undefined XP
    1
    2
  • Replace the na.rm argument with ... in the signature and body of calc_harmonic_mean().