Search code examples
rpackageroxygen2

R package: demonstrate a failing example


I'm writing an R package, where users are expected to run transform the data with my function in the way that is bound to fail. I want to add two examples to this function - one where the "default" run throws an error, and the second where the data is quite aggressively filtered (can't make this a default).

How do I add the example for the first case, where the code is bound to fail?


Solution

  • You can add it within a \dontrun{} block so that it does not cause errors. http://r-pkgs.had.co.nz/man.html#man-functions