Post #1891071
2023-08-08 06:51 UTC
Replies (6)
-
@jimgar@fosstodon.org 2023-08-08 07:32
@djnavarro@fosstodon.org Awesome post, I think I have lots to learn from this, especially about the tabular data at the end. One addition if I may: stopifnot can produce informative messages. You have to provide it in the named arg way, like stopifnot(“Value is not scalar” = length(value) == 1) I’ve been using this method for asserting that inputs to functions are robustly checked. It can get ugly. But there’s no package dependencies… but maybe a minimum R version 🤔 I can’t remember when it was introduced.
-
@ihaddadenfodil@mastodon.social 2023-08-08 07:52
@djnavarro@fosstodon.org you just forgot to mention the best package in this subject: checkmate
-
@modrak_m@fediscience.org 2023-08-08 11:02
@djnavarro@fosstodon.org 100%!!! As a shameless plug, a long time ago I wrote a short post about a similar topic, with verifying joins as an example: https://www.martinmodrak.cz/2018/09/17/tests-in-r-markdown/ Now that dplyr joins support those checks internally via the `unmatched`, `multiple` and `relationship` arguments there's even less reason to not doing those checks... People, check you joins!
-
@milesmcbain@fosstodon.org 2023-08-08 11:18
@djnavarro@fosstodon.org I enjoy testthat in this role due to assertion failure detail
-
@brianrepko@hachyderm.io 2023-08-08 18:52
@djnavarro@fosstodon.org This is awesome - I'm currently using `{checkmate}`which is mentioned in the "three other packages for this but a girl only has so many rhymes in her" category.
-
@dstephenlindsay@mastodon.social 2023-08-09 03:33
@djnavarro@fosstodon.org Engaging writing on a super important issue. I’m too unskilled to follow the details well, but the core argument is compelling.