Robert Leaf Home

CV

Extended CV (pdf)

R Packages for ASPIC

Information for Prospective
Graduate Students

 

R Packages
Robert Thomas Leaf, Ph.D.

I have developed a package of R functions to more easily and consistently plot the output from one or many .rdat files in a directory. The .rdat files are created by the ASPIC program from .inp files. The motivation for creating the aspic.plot package was to create a flexible suite of plotting routines that could handle the variable nature of .rdat files. For example, a routine that would scan the headers and extract tabular data regardless of how many indices or data sources are used in a model. I encourage users to download and customize the scripts as necessary – or use them freely for their own purposes.

Links are provided at the end of this page for downloading the ASPIC.PLOT suite of functions and ASPIC.

“aspic.plot” is a suite of functions to plot .rdat files created by the NOAA Fisheries Toolbox program "ASPIC," a commonly used program in fishery science and stock assessment. The package contains a number of plotting functions, an extraction and aggregation function, and an R analog to Matlab's “strncmpi” which is used by the various plotting functions.

The foundation of the code is the function ASPIC_rdata_input. This function scans the .rdat files in the current directory and asks the user which he would like to process. The function has no arguments and returns a list containing the extracted data from the .rdat files.

Downloads

Plotting Routines

Correlation_Matrix_Plot()

A function that scans the .rdat files from multiple or singule ASPIC model runs and creates a scatterplot matrix.

A function that scans the .rdat files from multiple or singule ASPIC model runs and creates a scatterplot matrix.

Plot_Individual_Indices()

The correlation matrix plotting function models derived and input data in a pairwise fashion. The user is asked to pick a single value for index.1 and index.2 using the GUI. Press okay when finished. The x- and y-labels should match the chosen indices.

Plots model derived and input data in a pairwise fashion. The user is asked to pick a single value for index.1 and index.2 using the GUI. Press okay when finished. The x- and y-labels should match the chosen indices.

Example 1.

Plot_Individual_Indices("Surplus Production","Landings",T)

Example 1 - Plot_Individual_Indices("Surplus Production","Landings",T)

Example 2.

Plot_Individual_Indices("Annual F / FMSY","Landings",T)

Example 2 - Plot_Individual_Indices("Annual F / FMSY","Landings",T)

Plot_Model_Residuals()

This function plots the residuals using a 'histogram' like (or 'high-density') vertical lines.

This function plots the residuals using a 'histogram' like (or 'high-density') vertical lines.

Plot_Multiple_Stock_Fishery_Status()

Function creates a two panel plot of the stock and fishery status from multiple .rdat files.

Function creates a two panel plot of the stock and fishery status from multiple .rdat files.

Plot_Observed_and_Expected()

This function plots the observed index values and the modeled (expected) values.

Function - This function plots the observed index values and the modeled (expected) values.

Plot_Stock_Fishery_Status()

Plots the fishery and stock status estimated from an ASPIC model run in the same panel.

Function - Plots the fishery and stock status estimated from an ASPIC model run in the same panel.