Object: Call fortran subroutine using R
Platform: window 10, Fortranfortran (Intel Visual Fortran), R (3.1.3)
Testing code source: https://en.wikiversity.org/wiki/R_(programming_language)/Tutorials/Connecting_Fortran_and_R
Fortran code (multiply.f):
c sample subroutine to include for R
subroutine multiply(ax,bx,cx)
implicit none
integer ax,bx,cx
cx=ax*bx
end
R code (testfortran.R):
setwd('C:/Personal/code/C/RcallF')
system('R CMD SHLIB multiply.f')
dyn.load('C:/Personal/code/C/RF/multiply.dll')
star = fun