How to not run an example using roxygen2?

后端 未结 4 1804

I\'m writing a geocoding function right now that relies on having a Bing Maps Key. Obviously I\'d rather not publish mine, and the examples fail without one.

How do

4条回答
  •  温柔的废话
    2020-12-08 13:21

    You can use \donttest{} to your example. The snippet will be provided in your documentation, but won't get tested with the R CMD Check.

    For more info --> ?example

    #' @example
    \donttest{
        2^2
        }
    

    This 2^2 won't get run when you run devtools::check()

    Do check it yourself before judging. :)

提交回复
热议问题