Skip to content

Commit

Permalink
fix file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
MOshima-PIFSC committed Jan 5, 2024
1 parent fa7d4b4 commit 3df3f30
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
6 changes: 3 additions & 3 deletions vignettes/articles/Jitter.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ r4ss::run(dir = dir_jitter, exe = "ss3", verbose = FALSE)
## Jitter
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.

```{r}
Njitter <- 50
```{r run-jitter}
Njitter <- 5
jit.likes <- r4ss::jitter(dir = dir_jitter,
Njitter = Njitter,
init_values_src = 1,
Expand Down Expand Up @@ -92,7 +92,7 @@ converged_ssb <- jit_summary$SpawnBio %>%
pivot_longer(col = c(1:(Njitter+1)), names_to = "jitter", values_to = "SSB") %>%
pivot_wider(names_from = Yr, values_from = SSB) %>%
mutate(rownumber = seq(1, nrow(.))) %>%
column_to_rownames("jitter") %>%
tibble::column_to_rownames("jitter") %>%
filter_at(vars(1:(ncol(.)-1)), all_vars((.) < 2 & (.) > 0.5)) %>% #keep only
select(rownumber) %>%
pull(rownumber)
Expand Down
4 changes: 2 additions & 2 deletions vignettes/articles/Retrospective-Analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ file.copy(from ="../../inst/extdata/ss", to = dir_retro)
You will need to make sure you have the [SS executable](https://github.com/nmfs-stock-synthesis/stock-synthesis) file either in your path or in the directory you are running the retrospective from (in this case `dir_retro`). An easy way to get the latest release of stock synthesis is to use the `r4ss` function `get_ss3_exe()`.

```{r}
r4ss::get_ss3_exe(dir = dir_jitter, version = "v3.30.21")
r4ss::get_ss3_exe(dir = dir_retro, version = "v3.30.21")
```

## Retrospective Analysis
Once you have the 4 input files and SS executable, you can run retrospective analysis as shown below. We are running it for 5 1-year peels, so with each run, the last year of data is removed and the model is re-run for a total of 5 times. The number of year peels can be adjusted with the `years` argument. If the SS executable file you are using is named something other than "ss" (e.g. ss_opt_win.exe), you will need to specify this with the argument `exe = "ss_opt_win"`.

```{r message=FALSE}
r4ss::retro(dir = dir_retro, exe = "ss3", years = 0:-5, verbose = FALSE)
r4ss::retro(dir = dir_retro, exe = "ss3.exe", years = 0:-5, verbose = FALSE)
```
## Visualizing Output
Expand Down
10 changes: 2 additions & 8 deletions vignettes/articles/likelihood.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,10 @@ list.files(files_path)
file.copy(from = list.files(files_path, full.names = TRUE), to = dir_tmp)
```

```{r eval=FALSE, echo=FALSE, results = FALSE}
file.copy(from ="../../inst/extdata/ss", to = dir_tmp)
file.copy(from ="../../inst/extdata/ss", to = dir_profile)
```


You will need to make sure you have the [SS executable](https://github.com/nmfs-stock-synthesis/stock-synthesis) file either in your path or in the directory you are running the profile from (in this case `dir_profile`). An easy way to get the latest release of stock synthesis is to use the `r4ss` function `get_ss3_exe()`.

```{r}
r4ss::get_ss3_exe(dir = dir_jitter, version = "v3.30.21")
r4ss::get_ss3_exe(dir = dir_tmp, version = "v3.30.21")
```

## R0 Profile
Expand Down Expand Up @@ -83,7 +77,7 @@ profile(dir = dir_profile,
string = "SR_LN",
profilevec = r0_vec,
exe = "ss3",
verbose = FALSE)
verbose = TRUE)
```

## Visualizing Output
Expand Down

0 comments on commit 3df3f30

Please sign in to comment.