* using log directory 'd:/Rcompile/CRANpkg/local/3.6/imabc.Rcheck' * using R version 3.6.3 (2020-02-29) * using platform: x86_64-w64-mingw32 (64-bit) * using session charset: ISO8859-1 * checking for file 'imabc/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'imabc' version '1.0.0' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'imabc' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [12s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking examples ... ERROR 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) } $quantile_function function (n) { sims <- mapply(match.fun(quantile_fn), n, MoreArgs = quantile_inputs) return(sims) } $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) } $quantile_function function (n) { sims <- mapply(match.fun(quantile_fn), n, MoreArgs = quantile_inputs) return(sims) } $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) } $quantile_function function (n) { sims <- mapply(match.fun(quantile_fn), n, MoreArgs = quantile_inputs) return(sims) } $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 -> -> .validate_prior_function -> exists Execution halted * checking PDF version of manual ... OK * DONE Status: 1 ERROR