Skip to content

Commit

Permalink
post_plot_ind update
Browse files Browse the repository at this point in the history
  • Loading branch information
dustintharper committed Jan 9, 2024
1 parent b97b83d commit 1449309
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

# Example code in package build process
*-Ex.R
BPER_tester.R

# Output files from R CMD build
/*.tar.gz
Expand Down
11 changes: 8 additions & 3 deletions R/post_plot_ind.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,14 @@ post_plot_ind <- function(inv_out = inv_out,
tstep_age = as.numeric(tstep_age)

parm_out <- jout$BUGSoutput$sims.list[[parm]]
# if(ncol(parm_out) > 1 & !(tstep_age %in% ages_prox)){
# stop("Parameter of interest is time-dependent, 'tstep_age' is required. Value must be in kyr and included in vector of time step ages, 'ages_prox'")
# }
if(ncol(parm_out) > 1 & is.null(tstep_age)){
stop("Parameter of interest is time-dependent, 'tstep_age' is required. Value must be in kyr and included in vector of time step ages, 'ages_prox'.")
}

if(ncol(parm_out) > 1 & !(tstep_age %in% ages_prox)){
tstep_age <- ages_prox[(which.min(abs(ages_prox-tstep_age)))]
warning("'tstep_age' is not a value in 'ages_prox'. The nearest time step to 'tstep_age'in 'ages_prox' vector has been used.")
}

# set units for parameters
units <- ""
Expand Down

0 comments on commit 1449309

Please sign in to comment.