example code block error
Opened this issue · 0 comments
jbplot_Crisk
Example roxygen code block for jbplot_Crisk
is missing a reference to fit2
. This will cause an error if JABBA is checked with its examples. Error checks could be bypassed via \dontrun
, however it looks like jbplot_Crisk
documentation was designed to have working example code.
Lines 61 to 76 in 425f1cd
Looking further into the example code, fit2
may be extraneous; Removing the variable fixes the error without issue.
jbplot_ensemble
Another example code error was found at jbplot_ensemble
. Here is the error log:
Running examples in 'JABBA-Ex.R' failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: jbplot_ensemble
> ### Title: jbplot_ensemble()
> ### Aliases: jbplot_ensemble
>
> ### ** Examples
>
> data(iccat)
> bet <- iccat$bet
>
> # Fit Fox and Schaefer
> jb1 <- build_jabba(catch=bet$catch,
+ cpue=bet$cpue,
+ se=bet$se,
+ scenario = "Fox",
+ model.type="Fox")
><> Prepare JABBA input data <><
><> Assume Catch with error CV = 0.1 <><
><> Model type:Fox <><
><> Shape m =1.001
><> K prior mean =1079485.2368and CV =1(log.sd = 0.832554611157698)
><> r prior mean =0.2and CV =0.532940350027788(log.sd = 0.5)
><> Psi (B1/K) prior mean =0.9and CV =0.25withlnormdestribution
><> ALWAYS ENSURE to adjust default settings to your specific stock <><
> jb2 <- build_jabba(catch=bet$catch,
+ cpue=bet$cpue,
+ se=bet$se,
+ scenario = "Schaefer",
+ model.type="Schaefer")
><> Prepare JABBA input data <><
><> Assume Catch with error CV = 0.1 <><
><> Model type:Schaefer <><
><> Shape m =2
><> K prior mean =1079485.2368and CV =1(log.sd = 0.832554611157698)
><> r prior mean =0.2and CV =0.532940350027788(log.sd = 0.5)
><> Psi (B1/K) prior mean =0.9and CV =0.25withlnormdestribution
><> ALWAYS ENSURE to adjust default settings to your specific stock <><
> fit1 <- fit_jabba(jb1,
+ quickmcmc=TRUE,
+ verbose=TRUE)
Compiling model graph
Resolving undeclared variables
Allocating nodes
Graph information:
Observed stochastic nodes: 199
Unobserved stochastic nodes: 358
Total graph size: 4305
Initializing model
><> Produce results output of Fox model for jabba Fox <><
><> Scenario Fox_Fox completed in 0 min and 33 sec <><
> fit2 <- fit_jabba(jb2,
+ quickmcmc=TRUE,
+ verbose=TRUE)
Compiling model graph
Resolving undeclared variables
Allocating nodes
Graph information:
Observed stochastic nodes: 199
Unobserved stochastic nodes: 358
Total graph size: 4305
Initializing model
><> Produce results output of Schaefer model for jabba Schaefer <><
><> Scenario Schaefer_Schaefer completed in 0 min and 33 sec <><
> # Compare
> jbplot_ensemble(list(fit1,fit2))
Error in kb[kb$type == "prj", ] : incorrect number of dimensions
Calls: jbplot_ensemble -> pmin
Execution halted
In the example code block, a list with fit1
and fit2
passes trough jbplot_ensemble
as kb
. Error occurs where it attempts to look for columns or find data frames subset kb$type == "prj"
. fit1
and fit2
does not have this column in which throws the error.
Lines 158 to 160 in 425f1cd
To resolve this issue Separate list and data frame centric functionality.