X2RR-compatible output routines for AD Model Builder, C, C++, and Fortran

Summary

X2R solves the following problem:  Given a numerical model written in a compiled language, how can its structured output easily be transferred to R for postprocessing (graphing, further analysis)?

Software description

X2R is composed of three similar sets of software: C2R, ADMB2R, and For2R.  Each contains output routines to simplify transfer of complicated data structures from models written in a compiled language to R or S-PLUS.*

When X2R routines are called, the user's data is written as a structured ASCII file.  That file can be read by R or S-PLUS with a single dget() function call to become a data object of type list.  The list, of course, may contain components such as data frames, matrices, and other lists.  Thus not only numeric data, but also data structure, variable names, and dimension names can be transferred.

These are not R or S-PLUS functions; rather they are subroutine libraries to be used and compiled with programmers' own modeling codes.  Source code, examples, and users' guides are supplied.

Languages supported are Fortran 95 (with For2R), C and C++ (with C2R) and AD Model Builder* (with ADMB2R).  As Fortran 77 is a subset of Fortran 95, For2R may be called from Fortran 77, as long as a Fortran 95 compiler is used.

Related software

For those working in fish stock assessment, we offer a related group of R functions, FishGraph. The FishGraph functions create graphs useful in analysis of fish stock assessments whose output has been saved with X2R. They are equally applicable to assessment models programmed in R whose results are saved in suitable format. At present FishGraph functions only on Windows.

Warranty and license

X2R has been tested and used by the authors. However, any software may contain bugs. These works are classified by NOAA as experimental products, and the user is solely responsible for ascertaining suitability and correct operation. The software is offered with no warranty of any kind.

X2R was written while the authors were employed by or associated with the U.S. National Oceanic and Atmospheric Administration (NOAA). It may be freely redistributed as long as credit is given to the original authors.

Reporting bugs & requesting features

Bug reports, suggestions, and extensions are solicited (send to Prager or Martin). The authors will attempt to fix all bugs promptly and to add requested features as time and resources allow.

Authors

Michael H. Prager1, Jennifer L. Martin2, and Andi Stephens1

1National Marine Fisheries Service, NOAA
101 Pivers island Road
Beaufort, NC  28516  USA

2 National Marine Fisheries Service, NOAA
166 Water Street
Woods Hole, MA  02543  USA

email Mike Prager
email Jennifer Martin

* Product disclaimers