R/standardise-call.r

Defines functions standardise_call

Documented in standardise_call

#' Standardise a function call
#'
#' @param call A call
#' @param env Environment in which to look up call value.
#' @export
standardise_call <- function(call, env = parent.frame()) {
  stopifnot(is.call(call))
  f <- eval(call[[1]], env)
  if (is.primitive(f)) return(call)

  match.call(f, call)
}

Try the pryr package in your browser

Any scripts or data that you put into this service are public.

pryr documentation built on Jan. 18, 2023, 1:08 a.m.