[R] R and Fortran 9x -- advice

Mike Prager mike.prager at noaa.gov
Mon Nov 13 19:00:15 CET 2006


Tamas K Papp <tpapp at princeton.edu> wrote:

> I found some bottlenecks in my R code with Rprof.  First I wanted to
> rewrite them in C, but a colleague keeps suggesting that I learn
> Fortran, so maybe this is the time to do it...
> 
> 1) I hear bad things about Fortran.  Sure, F77 looks archaic, but
> F90/95 seems nicer.  Is it worth learning, especially when I plan to
> use it mainly from R?  Dusting off my C knowledge would take a bit of
> time too, and I never liked C that much.

I'll answer this from the perspective of someone who uses
Fortran 95 regularly.  It is a modern language, far more
reliable and flexible than Fortran 77 and quite well suited to
most scientific problems.  I do think it's worth learning,
particularly if C is not to your taste.

Two free compilers for Fortran 95 are available.  It seems that
g95 is complete, while gfortran is nearing completion.  There
are also several high-quality commercial compilers, some of
which are free under certain operating systems and/or conditions
and others of which (Lahey) are quite inexpensive if one is
willing to work from the command line or one's own editor.

I can't address questions of R interoperability  -- not
something I've done.

-- 
Mike Prager, NOAA, Beaufort, NC
* Opinions expressed are personal and not represented otherwise.
* Any use of tradenames does not constitute a NOAA endorsement.



More information about the R-help mailing list