Chapter 2 A list of key functions in the r4Casal2 package
2.1 Accessor functions
get_derived_quanitites()or for lazy people (like myself)get_dqs(). These will return all the derived quantities for a model output.get_selectivitieswill return a data frame with all the selectivity reports for a model output.get_selectivities_by_yearwill return a data frame with all the reports of typeselectivity_by_yearfrom a model output.get_catchabilitieswill return a data frame with all the catchability reports for a model output.get_fisherieswill return a data frame with information from aninstantaneous_mortalityprocess for a model output.get_BH_recruitmentwill return a data frame with information from arecruitment_beverton_holtprocess for a model output.get_abundance_observationswill return a data frame with information from anabundanceorbiomassobservation for a model output.get_composition_observationswill return a data frame with information from anproportion_at_length,proportion_at_age,process_removals_by_ageandprocess_removals_by_lengthobservation for a model output.get_composition_mean_binwill return a data frame with information from anproportion_at_length,proportion_at_age,process_removals_by_ageandprocess_removals_by_lengthsummarised as the mean length or mean age.get_tag_recapture_observationswill return a data frame with information from antag_recapture_by_length_for_growth,tag_recapture_by_lengthandtag_recapture_by_ageobservation for a model output.get_partitionwill return a data frame with partition data frompartitionreport.get_inital_partitionwill return a data frame with initial partitioninitialisation_partitionreport.get_profileWill return a data frame for aprofilereport.get_estimated_valuesWill return a data frame for aestimate_valuereport.get_transformed_parametersWill return a data frame for aparameter_transformationsreport.get_timevarying_parametersWill return a data frame for atime_varyingreport.get_simulated_age_residsWill reformat simulated data read in by theread.simulated.datafunction.get_projectionswill return a data frame of allprojectionreports from a model output.get_growthwill return a data frame of allage_lengthreport from a model output.get_covariancewill return a data frame of allcovariance_matrixreport from a model output.
2.2 Other useful functions
aggregate_objective_reportThis reformats an objective function report to be “similar” to CASALs output.create_simulation_reportsThis will create a range of@report.type=simulated_observationCasal2 reports that can help set up simulations. See Section 7 on why you want to do this.build_assessment_bookdownThis will create a bookdown template for an assessment model MPD run.summarise_configWill summarize input files see Section 3calculate_composition_stage_two_weightsCalculates the stage-two weights using Francis (2011) TA1.8 method.get_high_correlationsReturns index of parameters that have high correlations from MPD. This requires the Casal2 model to have reported thecorrelation_matrixrun_automatic_reweightingAutomatically apply iterative reweighting methods for a Casal2 modelextract_reweighted_mpdsextract all the reweighted mpds that are created byrun_automatic_reweighting. Useful to then plot the effect of reweightingerror_value_tableCreate a data.frame of all observations from a casal2 mpd run outlining likelihood type, observation type and error value by year and observation.summarise_estimated_parametersIf a model reportsestimate_summarythis function will extract two data frames that can be used to assess starting values and estimated values along with prior assumptions.plot_profileWill plot profiles for reports that have been run withcasal2 -pformat.