Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed Oct 10, 2024
1 parent c34a7af commit a9bd7b3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ss3/91-dynamic-B0.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
library(r4ss)
library(ggplot2)
library(dplyr)
source("ss3/fit_ss3.R")

system("cp -r ss3/A0 ss3/A0-dynamicB0")
Expand All @@ -7,7 +9,9 @@ d <- r4ss::SS_readdat("ss3/A0-dynamicB0/data.ss_new")
d$catch <- d$catch |>
mutate(catch = ifelse(year > 1950, 0, catch))

ggplot(filter(d$catch, year > 0), aes(year, catch)) + geom_line() + facet_wrap(~fleet, scales = "free_y")
ggplot(filter(d$catch, year > 0), aes(year, catch)) +
geom_line() +
facet_wrap(~fleet, scales = "free_y")

r4ss::SS_writedat(d, "ss3/A0-dynamicB0/data.ss", overwrite = T)

Expand Down Expand Up @@ -40,9 +44,7 @@ dat <- bind_rows(
mutate(dat_A0, type = "A0"),
mutate(dat_A0_dyn, type = "A0 dynamic B0 post 1950")
)

row.names(dat) <- NULL

library(ggplot2)
library(dplyr)
ggplot(dat, aes(year, Value, colour = type)) + geom_line()
ggplot(dat, aes(year, Value, colour = type)) +
geom_line()

0 comments on commit a9bd7b3

Please sign in to comment.