Skip to content

Commit

Permalink
fix in jitter file names
Browse files Browse the repository at this point in the history
  • Loading branch information
MOshima-PIFSC committed Feb 6, 2024
1 parent fcd5afe commit 993f1a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vignettes/articles/Jitter.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ r4ss::run(dir = dir_jitter, exe = "ss3", verbose = FALSE)
For this example, we will run 50 jitters. The `jitter()` function automates the entire process so you only need to give it a few arguments and it will run and produce the total likelihoods for each run. Full documentation of the `jitter()` function can be found at the [r4ss website](https://r4ss.github.io/r4ss/reference/jitter.html).

```{r run-jitter}
Njitter <- 50
Njitter <- 5
jit.likes <- r4ss::jitter(dir = dir_jitter,
Njitter = Njitter,
init_values_src = 1,
Expand All @@ -64,7 +64,7 @@ jit.likes <- r4ss::jitter(dir = dir_jitter,
To analyze the output of all 50 runs, use `r4ss::SSgetoutput()` and `r4ss::SSsummarize()` as shown below.

```{r }
jit_mods <- SSgetoutput(keyvec = c("",1:Njitter), #"" to include reference run (Report.sso)
jit_mods <- SSgetoutput(keyvec = 0:Njitter, #"" to include reference run (Report.sso)
getcomp = FALSE,
dirvec = dir_jitter,
getcovar = FALSE,
Expand All @@ -87,7 +87,7 @@ converged_grad <- which(jit_summary$maxgrad < 0.0001)
converged_ssb <- jit_summary$SpawnBio %>%
mutate(across(c(1:(Njitter+1)),
.fns = ~./replist)) %>% # for each column, divide SSB by SSB from the reference run (replist)
.fns = ~./replist0)) %>% # for each column, divide SSB by SSB from the reference run (replist)
select(-Label) %>%
pivot_longer(col = c(1:(Njitter+1)), names_to = "jitter", values_to = "SSB") %>%
pivot_wider(names_from = Yr, values_from = SSB) %>%
Expand Down

0 comments on commit 993f1a1

Please sign in to comment.