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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.