[R] calling a DLL/shared lib from R directly?

Jeff D. Hamann jeff_hamann at hamanndonald.com
Mon Sep 23 17:26:27 CEST 2002


Is it possible to call a basic function/subroutine in a DLL/shared lib from
within R without having to build an R package?

 I have a function like:

 void __stdcall testfunc2(
   unsigned long a,
   double b,
   unsigned long c  )
 {
   return a * b * c;
 }

 or=20

  subroutine fortran_2002_bh_age (sp,site,total_age,bh_age)
  integer*2 sp
  real*4 site=20
  real*4 total_age
  integer*2 bh_age

  real*4 x

  bh_age =3D some_value

  end subroutine

 I have been able to make it happen from the "writing R extensions" docs. =
 It pretty important that this library be R independent.=20

 I only get the digest version, so if you answer, could you send a copy =
 to my email address please?

 Thanks,
 Jeff.


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list