[R] .C and .Fortran

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Sep 3 19:04:12 CEST 2014


On 03/09/2014 13:28, Filippo Monari wrote:
> Hi,
> I'd like to know what is the difference between the functions .C() and
> .Fortran.
> I noticed that by enclosing my F90 subroutines in modules .Fortran()
> can't find them any more in the load table, while .C() still can. I also
> checked that the subroutine was loaded with the is.loaded() function...
> So can anyone explain to me the difference and which is better to use?

This is not the right list: see the posting guide.  But .Fortran is 
intended for *Fortran 77* code (as the help page says), and maps the 
supplied NAME argument in the same way as the Fortran 77 compiler does, 
which is often different from the way the C compiler does.

I would strongly recommend that new code uses .Call and a C wrapper to 
F90 code: it is a safer and more portable route.

If you want any more help, you need to follow the posting guide and

- post to R-devel,
- supply the 'at a minimum information' asked for there,
- supply the minimal example asked for, and what the messages you see are.

> Thanks in advance,
> Filippo
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK



More information about the R-help mailing list