ex <- dt %>% 
  filter(replicate=="rep_17" & penalty_fn == "L1" & time < 20) %>%
  select(time, fishstock, harvest_alt) %>%
  gather(variable, stock, -time) 
ggplot(ex) + 
  geom_line(aes(time, stock, col=variable), lwd=1) + 
  scale_color_discrete(labels=c(fishstock = "Stock size", harvest_alt = "Harvest policy"), name="") 
ex <- dt %>% 
  filter(replicate == "rep_1" & penalty_fn == "L1" & time < 20) %>%
  select(time, fishstock, harvest_alt) %>%
  gather(variable, stock, -time) 
ggplot(ex) + 
  geom_line(aes(time, stock, col=variable), lwd=1) + 
  scale_color_discrete(labels=c(fishstock = "Stock Size", harvest = "Harvest", alternate = "Stock size (Adj)", harvest_alt = "Harvest policy (Adj)"), name="") 
ex <- dt %>% 
  filter(replicate %in% paste0("rep_", 1:10) & penalty_fn == "L1" & time < 20) %>%
  select(time, fishstock, harvest_alt) %>%
  gather(variable, stock, -time, -replicate) 
ggplot(ex) + 
  geom_line(aes(time, stock, col=variable), lwd=1) + 
  scale_color_discrete(labels=c(fishstock = "Stock Size", harvest = "Harvest", alternate = "Stock size (Adj)", harvest_alt = "Harvest policy (Adj)"), name="") +  
  facet_wrap(~replicate) 


cboettig/pdg_control documentation built on May 13, 2019, 2:10 p.m.