Skip to content

Commit

Permalink
doc for avoid build-time dependency #76 (#91)
Browse files Browse the repository at this point in the history
* doc for avoid build-time dependency #76

* document() for Rd

* use preformatted

* No code with preformatted block
  • Loading branch information
mdsumner authored and jimhester committed Jul 30, 2019
1 parent 1650ad7 commit d3dd47d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions R/memoise.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@
#' repeated.
#' }
#'
#' It is recommended that functions in a package are not memoised at build-time,
#' but when the package is loaded. The simplest way to do this is within
#' \code{.onLoad()} with, for example
#'
#'
#' \preformatted{
#' # file.R
#' fun <- function() {
#' some_expensive_process()
#' }
#'
#' # zzz.R
#' .onLoad <- function(pkgname, libname) {
#' fun <<- memoise::memoise(fun)
#' }
#' }
#' @name memoise
#' @title Memoise a function.
#' @param f Function of which to create a memoised copy.
Expand Down
16 changes: 16 additions & 0 deletions man/memoise.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d3dd47d

Please sign in to comment.