Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-hulson committed Aug 7, 2024
2 parents 47c631f + 4e165fa commit 4680f0b
Showing 1 changed file with 34 additions and 31 deletions.
65 changes: 34 additions & 31 deletions R/get_output.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ get_ISS <- function(species = 21720,
sex %in% sex_cat) -> res
}
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, 'iss_ag')]]) %>%
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, '_iss_ag')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}
Expand All @@ -60,7 +60,7 @@ get_ISS <- function(species = 21720,
sex %in% sex_cat) -> res
}
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, 'iss_ln')]]) %>%
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, '_iss_ln')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}
Expand All @@ -73,11 +73,12 @@ get_ISS <- function(species = 21720,
tidytable::as_tidytable(data_iss[[region]]$prod_iss_caal) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, 'iss_caal')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
} else{
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, '_iss_caal')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}
}
}

Expand Down Expand Up @@ -124,7 +125,7 @@ get_popn <- function(species = 21720,
sex %in% sex_cat) -> res
}
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, 'base_age')]]) %>%
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, '_base_age')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}
Expand All @@ -148,7 +149,7 @@ get_popn <- function(species = 21720,
sex %in% sex_cat) -> res
}
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, 'base_length')]]) %>%
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, '_base_length')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}
Expand Down Expand Up @@ -185,21 +186,21 @@ get_comp <- function(species = 21720,
if(is.null(spec_case)){
tidytable::as_tidytable(data_iss[[region]]$prod_comp_age) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
sex_c %in% sex_cat) -> res
} else{
if(spec_case %in% c('bsre', 'dr', 'rebs')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_comp_age_', spec_case)]]) %>%
tidytable::filter(sex %in% sex_cat) -> res
tidytable::filter(sex_c %in% sex_cat) -> res
}
if(spec_case %in% c('ai_subreg', 'w_c_egoa', 'wc_egoa', 'w140')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_comp_age_', spec_case)]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
sex_c %in% sex_cat) -> res
}
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, 'comp_age')]]) %>%
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, '_comp_age')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
sex_c %in% sex_cat) -> res
}
}
}
Expand All @@ -209,21 +210,21 @@ get_comp <- function(species = 21720,
if(is.null(spec_case)){
tidytable::as_tidytable(data_iss[[region]]$prod_comp_length) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
sex_c %in% sex_cat) -> res
} else{
if(spec_case %in% c('bsre', 'dr', 'rebs')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_comp_length_', spec_case)]]) %>%
tidytable::filter(sex %in% sex_cat) -> res
tidytable::filter(sex_c %in% sex_cat) -> res
}
if(spec_case %in% c('ai_subreg', 'w_c_egoa', 'wc_egoa', 'w140')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_comp_length_', spec_case)]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
sex_c %in% sex_cat) -> res
}
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, 'comp_length')]]) %>%
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, '_comp_length')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
sex_c %in% sex_cat) -> res
}
}
}
Expand All @@ -234,11 +235,12 @@ get_comp <- function(species = 21720,
tidytable::as_tidytable(data_iss[[region]]$prod_comp_caal) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, 'comp_caal')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}else{
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, '_comp_caal')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}
}
}

Expand Down Expand Up @@ -284,7 +286,7 @@ get_bias <- function(species = 21720,
sex %in% sex_cat) -> res
}
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, 'bias_age')]]) %>%
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, '_bias_age')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}
Expand All @@ -308,7 +310,7 @@ get_bias <- function(species = 21720,
sex %in% sex_cat) -> res
}
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, 'bias_length')]]) %>%
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, '_bias_length')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}
Expand All @@ -321,11 +323,12 @@ get_bias <- function(species = 21720,
tidytable::as_tidytable(data_iss[[region]]$prod_bias_caal) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, 'bias_caal')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
} else{
if(spec_case %in% c('bin')){
tidytable::as_tidytable(data_iss[[region]][[paste0('prod_', spec_case, '_bias_caal')]]) %>%
tidytable::filter(species_code %in% species,
sex %in% sex_cat) -> res
}
}
}

Expand Down

0 comments on commit 4680f0b

Please sign in to comment.