Читать книгу The Big R-Book - Philippe J. S. De Brouwer - Страница 274

Hint – Use default values to keep code backwards compatible

Оглавление

We were confident that it was fine to over-ride the definition of the function my_mode. Indeed, if the function was already used in some older code, then one would expect to see only one mode appear. That behaviour is still the same, because we chose the default value for the optional parameter return.all to be FALSE. If the default choice would be TRUE, then older code would produce wrong results and if we would not use a default value, then older code would fail to run.

The Big R-Book

Подняться наверх