Exercise

Logical defaults

cut_by_quantile() is now slightly easier to use, but you still always have to specify the na.rm argument. This removes missing values—it behaves the same as the na.rm argument to mean() or sd().

Where functions have an argument for removing missing values, the best practice is to not remove them by default (in case you hadn't spotted that you had missing values). That means that the default for na.rm should be FALSE.

Instructions

100 XP
  • Update the definition of cut_by_quantile() so that the na.rm argument defaults to FALSE.
  • Remove the na.rm argument from the call to cut_by_quantile().