Skip to content

For2R - Interface from Fortran to R

1 message · Mike Prager

#
We announce the availability of the Fortran 95 module "For2R", which 
makes it easy to write complicated R data structures (i.e., lists of 
lists, matrices, dataframes, ...) from Fortran programs. By a series of 
subroutine calls, program outputs can be written to a file readable by R 
with a single "dget" function call. This facilitates automated graphics 
generation and other postprocessing of model results.

A downloadable ZIP file of For2R is available from  
http://shrimp.ccfhrb.noaa.gov/~mprager/Rinter.html  and includes Fortran 
source, documentation, and an example.

We are working on similar code to interface C++ with R. An extremely 
crude version of such code is available from the same page. Though the 
C++ code will be totally replaced, the download includes sample output 
and R graphics functions for automated processing of a fisheries example. 

Although For2R is much nicer than our current C++ code, it should all be 
considered beta-test code, and it is supplied with no warranty 
whatsoever.  Bug reports and suggestions are welcome.