Link to home
Start Free TrialLog in
Avatar of David_Zucker
David_Zucker

asked on

R to Fortran

Hi,
I am trying to learn how to call fortran subroutines from a program written in the statistical language R. I read up on this on the web, and got a very simple example to work, but with a more complex example I ran into trouble and I need some help. Attached is a zip file with the files pertaining to the more complex example (a Cox regression analysis), as follows:
Attached is a zip file, with the following relevant files:
1. fnewton.f = the fortran subroutine I am trying to run
2. fnewton.dll = the dll file I created from the fortran file
3. test.r = the R program that calls the fortran
4. coxdat.txt = the data set
(Note: with the first 3 files, I artificially added the extension.txt so that they would be uploadable on Experts Exchange.)
FYI, I have checked the subroutine fnewton.f and verified that it works (ie gives the correct answer for the Cox regression coefficient on the attached dataset).
I'd be grateful for help in working this out.
Thanks,
David R-to-Fortran.zip
SOLUTION
Avatar of JesterToo
JesterToo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the update and the points David.  I'm glad you found the solution.

Regards,
Lynn
Avatar of David_Zucker
David_Zucker

ASKER

I got the answer.