Skip to content

TylerGrantSmith/s3sink

Repository files navigation

s3sink

R build status Lifecycle: experimental Codecov test coverage

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("TylerGrantSmith/s3sink")

Example

library(s3sink)

plotting_function <- function() {
  g <- ggplot2::ggplot(mtcars) + ggplot2::geom_point(ggplot2::aes(mpg, disp))
  print(g)
  invisible(NULL)
}

sink_s3("print.ggplot", "ggplot2")
plotting_function()
#> Registered S3 method overwritten by 'ggplot2':
#>   method       from
#>   print.ggplot

out <- unsink_s3("print.ggplot")

str(out, 1)
#> List of 1
#>  $ :List of 9
#>   ..- attr(*, "class")= chr [1:2] "gg" "ggplot"

About

Captures the inputs to S3 functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages