You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The R Packages (2e) book is fantastic and has been enormously helpful as I'm developing a new package. Having read it now all the way through, there is just one section that left me a bit confused, in 14.5.2 on testing errors. Would it be possible to clarify the part about the class of a condition? It would be really good to have an example here (or earlier in the book) of how to attach a custom class to a condition, when writing a function, ready for use in expect_error(). (I did figure it out, but it took digging through the source code of stringr, then rlang, plus a chapter of Advanced R and a couple of other blog posts to get there).
(If this counts as a contribution, then I assign the copyright of said contribution to Hadley Wickham).
The text was updated successfully, but these errors were encountered:
Hello,
The R Packages (2e) book is fantastic and has been enormously helpful as I'm developing a new package. Having read it now all the way through, there is just one section that left me a bit confused, in 14.5.2 on testing errors. Would it be possible to clarify the part about the class of a condition? It would be really good to have an example here (or earlier in the book) of how to attach a custom class to a condition, when writing a function, ready for use in
expect_error()
. (I did figure it out, but it took digging through the source code of stringr, then rlang, plus a chapter of Advanced R and a couple of other blog posts to get there).(If this counts as a contribution, then I assign the copyright of said contribution to Hadley Wickham).
The text was updated successfully, but these errors were encountered: