Skip to content

Commit

Permalink
docs: run devtools::document, correct errors, run readme again
Browse files Browse the repository at this point in the history
  • Loading branch information
k-doering-NOAA committed Jul 7, 2020
1 parent 767ad3a commit e4248c2
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 33 deletions.
2 changes: 1 addition & 1 deletion R/runSSMSE.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ run_SSMSE <- function(scen_name_vec = c("scen_1", "scen_2"),
}
if(is.null(rec_dev_pars)) {
# to do: make this a better default value.
rec_dev_pars <- c(ceiling(mean(yrs_assess_vec)), 1)
rec_dev_pars <- c(ceiling(mean(nyrs_assess_vec)), 1)
}

# make sure values are the correct length
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ copy_SS_inputs <- function(dir.old = NULL,
#' @param iter_vec The number of iterations per scenario. A vector of integers
#' in the same order as scen_name_vec.
#' @returns A list of length 3 with 1) the global seed value; 2) the scenario seed values; and 3) the iteration seed values.
#' @example set_MSE_seeds(seed = seq(10, 80, by = 10), iter_vec = c(2, 3))
#' @examples set_MSE_seeds(seed = seq(10, 80, by = 10), iter_vec = c(2, 3))
set_MSE_seeds<-function(seed = NULL, iter_vec)
{
if(is.null(seed)){
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ library(r4ss) #install using remotes::install_github("r4ss/r4ss@development)
# Create a folder for the output in the working directory.
run_SSMSE_dir <- file.path("run_SSMSE-ex")
dir.create(run_SSMSE_dir)
## Warning in dir.create(run_SSMSE_dir): 'run_SSMSE-ex' already exists
```

The cod model with H = 0.65 is included as external package data.
Expand All @@ -108,7 +109,10 @@ cod_mod_path <- system.file("extdata", "models", "cod", package = "SSMSE")
file.copy(from = cod_mod_path, to = run_SSMSE_dir, recursive = TRUE)
## [1] TRUE
file.rename(from = file.path(run_SSMSE_dir, "cod"), to = file.path(run_SSMSE_dir, "cod-1"))
## [1] TRUE
## Warning in file.rename(from = file.path(run_SSMSE_dir, "cod"), to =
## file.path(run_SSMSE_dir, : cannot rename file 'run_SSMSE-ex/cod' to 'run_SSMSE-
## ex/cod-1', reason 'Access is denied'
## [1] FALSE
cod_1_path <- file.path(run_SSMSE_dir, "cod-1")
# make model read initial values from control file and not ss.par
start <- r4ss::SS_readstarter(file = file.path(cod_1_path, "starter.ss"), verbose = FALSE)
Expand All @@ -121,14 +125,14 @@ r4ss::SS_changepars(dir = cod_1_path, ctlfile = "control.ss_new",
## [1] "SR_BH_steep"
## These are the ctl file lines as they currently exist:
## LO HI INIT PRIOR PR_SD PR_type PHASE env_var&link dev_link dev_minyr
## 107 0.2 1 0.65 0.7 0.05 0 -4 0 0 0
## 107 0.2 1 1 0.7 0.05 0 -4 0 0 0
## dev_maxyr dev_PH Block Block_Fxn Label Linenum
## 107 0 0 0 0 SR_BH_steep 107
## line numbers in control file (n=1):
## 107
## wrote new file to control_modified.ss with the following changes:
## oldvals newvals oldphase newphase oldlos newlos oldhis newhis oldprior
## 1 0.65 1 -4 -4 0.2 0.2 1 1 0.7
## 1 1 1 -4 -4 0.2 0.2 1 1 0.7
## newprior oldprsd newprsd oldprtype newprtype comment
## 1 0.7 0.05 0.05 0 0 # SR_BH_steep
# remove files with M = 0.2
Expand Down
31 changes: 15 additions & 16 deletions man/build_rec_devs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified man/figures/README-plot_SSB-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 2 additions & 12 deletions man/run_SSMSE.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/set_MSE_seeds.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e4248c2

Please sign in to comment.