The Design of Everyday R Functions
:: notes - Show a my_function <- function(x, y) {} example. - Have something real in mind. Maybe F to C conversion? No, something with at least 2 inputs. - Rename to make it obvious what’s expected. - Defaults can also help make things obvious. ::
:: notes - Show stbl::to_int() vs as.integer() (NAs introduced) vs over-strict vctrs::vec_cast("1", integer()) - Use this to lead to error section. ::
:: notes - Show error messages before stbl. x + y throws fun, hard to understand errors. - Show stbl-style errors. ::