Link to home
Create AccountLog 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
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
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.