Skip to content

Commit

Permalink
Small updates to readme, reading .gz files, and restoring mistakenly …
Browse files Browse the repository at this point in the history
…deleted output files
  • Loading branch information
mpinsky committed Aug 18, 2020
1 parent d259de3 commit 2e98d0d
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ All figures and Table S1 are produced by [plot_figures.r](code/plot_figures.r).<
1. Kappa thresholds from Morley et al. 2018 PLOS ONE: see above
1. [Table S1](tables/tableS1.csv)
1. output/prioritizr_runs/solution\_\*.csv and output/prioritizr_runs/spp\_\*.csv: see above

1. Table S4
1. [output/fishery_spps.csv](output/fishery_spps.csv): see above

## InVEST runs
These are the detailed program settings used when InVEST was run.
Expand Down
4 changes: 2 additions & 2 deletions code/5.2_evalprioritizr.r
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ write.csv(goalsmetbymod2, file = paste0('output/goalsmetbymod_', runname2out, '.


# read back in if needed
goalsbyzonebymod1 <- fread(paste0('gunzip -c output/goalsbyzonebymod_', runname1out, '.csv.gz'), drop = 1)
goalsbyzonebymod2 <- fread(paste0('gunzip -c output/goalsbyzonebymod_', runname2out, '.csv.gz'), drop = 1)
goalsbyzonebymod1 <- fread(paste0('output/goalsbyzonebymod_', runname1out, '.csv.gz'), drop = 1)
goalsbyzonebymod2 <- fread(paste0('output/goalsbyzonebymod_', runname2out, '.csv.gz'), drop = 1)
goalsmetbymod1 <- fread(paste0('output/goalsmetbymod_', runname1out, '.csv'), drop = 1)
goalsmetbymod2 <- fread(paste0('output/goalsmetbymod_', runname2out, '.csv'), drop = 1)
5 changes: 4 additions & 1 deletion code/plot_figures.r
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ rcps <- sort(unique(goalsmetbymod1$rcp))
# Statistics
# goals met, mid-century or end-of-century (for text)
goalsmetbymod[year_range == '2041-2060', .(mean = mean(pmetstrict), sd = sd(pmetstrict)), by = c('type')] # mean and se across models and goals
goalsmetbymod[year_range == '2081-2100', .(mean = mean(pmetstrict), sd = sd(pmetstrict)), by = c('type')] # mean and se across models and goals

goalsmetbymod[year_range == '2081-2100' & rcp == '26', .(mean = mean(pmetstrict), sd = sd(pmetstrict)), by = c('type')] # mean and se across models and goals
goalsmetbymod[year_range == '2081-2100' & rcp == '85', .(mean = mean(pmetstrict), sd = sd(pmetstrict)), by = c('type')] # mean and se across models and goals


# p(80% goals met), end-of-century (for text)
goalsmetbymod[year_range == '2081-2100', .(prop = 1 - sum(pmetstrict > 0.7)/.N), by = c('type')]
Expand Down
Binary file added output/goalsbyzonebyensemble_2per_all.csv.gz
Binary file not shown.
Binary file added output/goalsbyzonebyensemble_hist_all.csv.gz
Binary file not shown.
Binary file added output/goalsbyzonebymod_2per_all.csv.gz
Binary file not shown.
Binary file added output/goalsbyzonebymod_hist_all.csv.gz
Binary file not shown.

0 comments on commit 2e98d0d

Please sign in to comment.