Running examples in ‘imabc-Ex.R’ failed
The error most likely occurred in:

> ### Name: PriorsSpecification
> ### Title: Specify the Prior Distributions for All Parameters
> ### Aliases: PriorsSpecification add_prior define_priors as.priors
> 
> ### ** Examples
> 
> add_prior(dist_base_name = "norm")
$parameter
NULL

$density_function
function (n) 
{
    sims <- mapply(match.fun(density_fn), n, MoreArgs = density_inputs)
    return(sims)
}
<bytecode: 0x7fb09e038ce0>
<environment: 0x7fb09e049ff0>

$quantile_function
function (n) 
{
    sims <- mapply(match.fun(quantile_fn), n, MoreArgs = quantile_inputs)
    return(sims)
}
<bytecode: 0x7fb09e04a878>
<environment: 0x7fb09e049ff0>

$min
[1] -Inf

$max
[1] Inf

$distribution
[1] "norm"

$fun_inputs
NULL

attr(,"class")
[1] "prior" "imabc"
> add_prior(density_fn = "dnorm", mean = 50, sd = 10)
$parameter
NULL

$density_function
function (n) 
{
    sims <- mapply(match.fun(density_fn), n, MoreArgs = density_inputs)
    return(sims)
}
<bytecode: 0x7fb09e038ce0>
<environment: 0x7fb09e09cb18>

$quantile_function
function (n) 
{
    sims <- mapply(match.fun(quantile_fn), n, MoreArgs = quantile_inputs)
    return(sims)
}
<bytecode: 0x7fb09e04a878>
<environment: 0x7fb09e09cb18>

$min
[1] -Inf

$max
[1] Inf

$distribution
[1] "norm"

$fun_inputs
mean   sd 
  50   10 

attr(,"class")
[1] "prior" "imabc"
> add_prior(quantile_fn = "qnorm", min = 0, max = 1)
$parameter
NULL

$density_function
function (n) 
{
    sims <- mapply(match.fun(density_fn), n, MoreArgs = density_inputs)
    return(sims)
}
<bytecode: 0x7fb09e038ce0>
<environment: 0x7fb09e122b20>

$quantile_function
function (n) 
{
    sims <- mapply(match.fun(quantile_fn), n, MoreArgs = quantile_inputs)
    return(sims)
}
<bytecode: 0x7fb09e04a878>
<environment: 0x7fb09e122b20>

$min
[1] 0

$max
[1] 1

$distribution
[1] "norm"

$fun_inputs
NULL

attr(,"class")
[1] "prior" "imabc"
> 
> # x1, x2, and x3 reflect three parameters in the mdoel.
> x1 <- add_prior(dist_base_name = "norm")
> define_priors(
+   x1 = x1,
+   x2 = add_prior(density_fn = "dnorm", mean = 50, sd = 10),
+   add_prior(parameter_name = "x3", quantile_fn = "qnorm", min = 0, max = 1)
+ )
There are 3 defined parameters.

Parameter x1 has the following specifications:
Distribution base name: norm
User specified inputs: NA
Allowable range: -Inf - Inf
Empirical Standard Deviation: 0

Parameter x2 has the following specifications:
Distribution base name: norm
User specified inputs: mean = 50, sd = 10
Allowable range: -Inf - Inf
Empirical Standard Deviation: 0

Parameter x3 has the following specifications:
Distribution base name: norm
User specified inputs: NA
Allowable range: 0 - 1
Empirical Standard Deviation: 0> 
> x1_min <- 0.1
> x2_min <- 0.5
> x1_max <- 0.9
> x2_max <- 1.1
> df <- data.frame(
+   name_var = c("x1", "x2", "x3"),
+   dist_var = c("unif", NA, NA),
+   density_var = c(NA, "dtruncnorm", NA),
+   quantile_var = c(NA, NA, "qnorm"),
+   mean = c(NA, 0.75, 0.5),
+   sd = c(NA, 0.05, NA),
+   min = c(x1_min, x2_min, NA),
+   max = c(x1_max, x2_max, NA),
+   a = c(NA, x2_min, NA),
+   b = c(NA, x2_max, NA)
+ )
> as.priors(
+   df,
+   parameter_name = "name_var", dist_base_name = "dist_var",
+   density_fn = "density_var", quantile_fn = "quantile_var"
+ )
Error in exists(fn_name, mode = "function") : invalid first argument
Calls: as.priors ... do.call -> <Anonymous> -> .validate_prior_function -> exists
Execution halted