[R] RE: [Rd] F90

From: Gorjanc Gregor <Gregor.Gorjanc_at_bfro.uni-lj.si>
Date: Sun 27 Mar 2005 - 18:10:47 EST


Göran, thanks.

Happy easter!

-----Original Message-----
From: Göran Broström [mailto:gb@stat.umu.se] Sent: ned 2005-03-27 07:38
To: Gorjanc Gregor
Cc: r-help@stat.math.ethz.ch
Subject: Re: [Rd] F90  

On Sun, Mar 27, 2005 at 03:26:39AM +0200, Gorjanc Gregor wrote:
> Hello!
>
> Has anyone successfully compiled F90 sources in R-package? I found the
> same question on r-devel list from 2002 and I wonder if there is any
> progress. I heard that g95 and gfortran can be usable.
>
> And one more thing. I have a program written in F90 and lets suppose that
> compiler is not a problem. I've read manual 'Writing R Extensions' and
> successfully loaded one F77 subroutine in R for test and I had no problem.
> However, what is the strategy if one has a whole program i.e. main program
> + subroutines and wants to call it from R?

Well, you have essentially two options:

  1. Rewrite your main program as an R function, from which you call the subroutines (thru the .Fortran interface).
  2. Rewrite your main program as a Fortran subroutine, write an R wrapper, that calls your new subroutine (thru the .Fortran interface).

Choose whatever is simplest.

Göran

>
> Thanks in advance!
>
> --
> Lep pozdrav / With regards,
> Gregor Gorjanc
>
> ------------------------------------------------------------------------
> University of Ljubljana
> Biotechnical Faculty URI: http://www.bfro.uni-lj.si/MR/ggorjan
> Zootechnical Department email: gregor.gorjanc <at> bfro.uni-lj.si
> Groblje 3 tel: +386 (0)1 72 17 861
> SI-1230 Domzale fax: +386 (0)1 72 17 888
> Slovenia
>
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
 Göran Broström                    tel: +46 90 786 5223
 Department of Statistics          fax: +46 90 786 6614
 Umea University                   http://www.stat.umu.se/egna/gb/
 SE-90187 Umea, Sweden             e-mail: gb@stat.umu.se

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Sun Mar 27 18:17:44 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:56 EST