R/validate_prior_function.R

Defines functions .validate_prior_function

.validate_prior_function <- function(x) {
  # Check that function provided exists
  fn_name <- eval(x)
  e <- sprintf("The function %s cannot be found. Check the spelling or that it is loaded into your environment", eval(fn_name))
  if (!exists(fn_name, mode = 'function')) { stop(e) }

  return(fn_name)
}

Try the imabc package in your browser

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

imabc documentation built on April 12, 2021, 9:06 a.m.