knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
Simplify maintenance of NSE-SE pairs. Hypothetical dplyr
example:
#' @export #' @keywords internal mutate_ <- function (.data, ..., .dots) { UseMethod("mutate_") } #' @export #' @name mutate mutate <- lazyforward::lazyforward("mutate_")
The result:
lazyforward::lazyforward("mutate_", asNamespace("dplyr")) dplyr::mutate
The difference: You don't need to remember updating the interface and the forwarding logic if the interface of the SE version changes.
If the forwarding logic has been already written by hand, it may be simpler just to verify that it is correct:
testthat::with_reporter( "summary", testthat::test_that( "mutate forwarder is implemented correctly", lazyforward::expect_lazyforward("mutate", env = asNamespace("dplyr")) ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.