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.