Skip to content

Commit

Permalink
docs: fix so running in parallel works
Browse files Browse the repository at this point in the history
running in paralle uses the INSTALLED package, instead of load_all
  • Loading branch information
k-doering-NOAA committed Sep 15, 2020
1 parent ee336f5 commit 25546a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
14 changes: 6 additions & 8 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,16 @@ Note that this is a simple example and not a true MSE, so the OM and EM structur

### Setup R workspace folders
First, we will load the `SSMSE` package and create a folder in which to run the example:
```{r, eval=FALSE}
```{r, echo=FALSE, results="hide"}
devtools::install_local(".", upgrade = "never", quiet = TRUE)
```
```{r, eval=TRUE}
library(SSMSE) #load the package
library(r4ss) #install using remotes::install_github("r4ss/r4ss@development)
library(foreach) #if using run_parallel = TRUE
library(doParallel) #if using run_parallel = TRUE
```
```{r, echo=FALSE, results="hide"}
devtools::load_all(".") # for rendering this readme when it is in the SSMSE pkg
library(r4ss)
library(foreach) #if using run_parallel = TRUE
library(doParallel) #if using run_parallel = TRUE
```

```{r}
# Create a folder for the output in the working directory.
run_SSMSE_dir <- file.path("run_SSMSE-ex")
Expand Down Expand Up @@ -199,7 +197,7 @@ run_SSMSE(scen_name_vec = c("H-ctl", "H-1"),# name of the scenario
scope = "2", # to use the same recruitment devs across scenarios.
impl_error_pattern = "none", # Don't use implementation error
run_EM_last_yr = FALSE, # Run the EM in 106
run_parallel = FALSE,
run_parallel = TRUE,
sample_struct_list = sample_struct_list, # How to sample data for running the EM.
seed = 12345) #Set a fixed integer seed that allows replication
```
Expand Down
17 changes: 3 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,10 @@ library(SSMSE) #load the package
library(r4ss) #install using remotes::install_github("r4ss/r4ss@development)
library(foreach) #if using run_parallel = TRUE
library(doParallel) #if using run_parallel = TRUE
## Loading required package: iterators
## Loading required package: parallel
```

## Loading SSMSE
## Loading required package: iterators
## Loading required package: parallel

``` r
# Create a folder for the output in the working directory.
run_SSMSE_dir <- file.path("run_SSMSE-ex")
Expand Down Expand Up @@ -330,7 +328,7 @@ run_SSMSE(scen_name_vec = c("H-ctl", "H-1"),# name of the scenario
scope = "2", # to use the same recruitment devs across scenarios.
impl_error_pattern = "none", # Don't use implementation error
run_EM_last_yr = FALSE, # Run the EM in 106
run_parallel = FALSE,
run_parallel = TRUE,
sample_struct_list = sample_struct_list, # How to sample data for running the EM.
seed = 12345) #Set a fixed integer seed that allows replication
```
Expand Down Expand Up @@ -363,18 +361,9 @@ in year 103 (cod\_EM\_103), and the EM run with last year of data in 106
``` r
library(ggplot2) # use install.packages("ggplot2") to install package if needed
library(tidyr) # use install.packages("tidyr") to install package if needed
##
## Attaching package: 'tidyr'
## The following object is masked from 'package:testthat':
##
## matches
library(dplyr)
##
## Attaching package: 'dplyr'
##
## The following object is masked from 'package:testthat':
##
## matches
## The following objects are masked from 'package:stats':
##
## filter, lag
Expand Down

0 comments on commit 25546a0

Please sign in to comment.