[R] recomile a dll file in R

R. Michael Weylandt michael.weylandt at gmail.com
Sat Jan 21 18:32:02 CET 2012


You have a couple of major points of confusion that I'll address
briefly and then direct you to appropriate reference material.

I) R is not compiled. It is an interpreted language.

2) R and Fortran are not equivalent. Something that is good code in
one is not likely to be good code, or even valid code, in the other.

3) source() only tells R to execute a sequence of commands
sequentially (with some printing options turned off) -- no more, no
less. It's almost the same as running those commands directly at the
interpreter.

If you want to learn to use compiled routines within an R context,
please look at http://cran.r-project.org/doc/manuals/R-exts.html,
particularly chapter 5, and ? .Fortran

Any further help will require you give, at an absolute minimum, OS and
R version information and will likely require information about your
fortran compiler (probably best to use R's provided ones -- either at
http://cran.r-project.org/ (click through for your OS)) and which
fortran you are using (they aren't all equally supported).

Michael

On Sat, Jan 21, 2012 at 4:12 AM, parvin sabeghi <bahar.sabeghi at gmail.com> wrote:
> dear all,
> I created a dll file from a fortran program. How I can recompile it in R? I
> use "dyn.load(F:/myprogram.dll)"  without any error but  when I run
> "source(F:/myprogram.r)"  this error occurs:
> "Error in file(file, "r", encoding = encoding) :
>  cannot open the connection
> In addition: Warning message:
> In file(file, "r", encoding = encoding) :
>  cannot open file 'F:/condlogic.r': No such file or directory"
>
> how should I recompile this dll file and if my process is true, How I can
> create "myprogram.r" file?
> thanks a lot for any help.
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list