diff --git a/R/zzz-methods.R b/R/zzz-methods.R index bc56fee3..245f8abc 100644 --- a/R/zzz-methods.R +++ b/R/zzz-methods.R @@ -4,6 +4,19 @@ #' for the duraton of the session, or until a call to `methods_restore()`. #' #' @return Called for their side effects. +#' @examples +#' tibble(a = 1:3) %>% +#' mutate(b = a + 1) +#' +#' methods_overwrite() +#' +#' tibble(a = 1:3) %>% +#' mutate(b = a + 1) +#' +#' methods_restore() +#' +#' tibble(a = 1:3) %>% +#' mutate(b = a + 1) methods_overwrite <- methods_overwrite #' @rdname methods_overwrite diff --git a/man/methods_overwrite.Rd b/man/methods_overwrite.Rd index 8612912a..11a97e41 100644 --- a/man/methods_overwrite.Rd +++ b/man/methods_overwrite.Rd @@ -16,3 +16,17 @@ Called for their side effects. After calling \code{methods_overwrite()}, all dplyr methods are redirected to duckplyr for the duraton of the session, or until a call to \code{methods_restore()}. } +\examples{ +tibble(a = 1:3) \%>\% + mutate(b = a + 1) + +methods_overwrite() + +tibble(a = 1:3) \%>\% + mutate(b = a + 1) + +methods_restore() + +tibble(a = 1:3) \%>\% + mutate(b = a + 1) +}