#' Duplicate a function. Returns a carbon copy of the original, so that original
#' can be modified safely.
#'
#' @examples
#' \dontrun{
#' fn <- function(x) cat(x, "\n")
#' fn2 <- duplicate(fn)
#' fn <- function(x) cat(x, "woof","\n")
#' fn("hello") # hellowoof
#' fn2("hello") # hello
#' }
#' @export
#' @useDynLib vcr duplicate_
duplicate <- function(x) {
.Call(duplicate_, x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.