From arne.henningsen at googlemail.com  Fri Sep 11 16:48:23 2009
From: arne.henningsen at googlemail.com (Arne Henningsen)
Date: Fri, 11 Sep 2009 16:48:23 +0200
Subject: [Rd] Fortran routine affected by unrelated R code
Message-ID: <ee2a35a60909110748o89ae7basd8ff1ebc204f264e@mail.gmail.com>

Hi!

When I run "R CMD check" on the current development version of my R
package "frontier" [1], there is no difference between the output of
the test scripts in the /tests/ folder and the saved output files
(.Rout.save). However, if I change an R file in the /R/ folder, some
calls to the Fortran code (called by ".Fortran()") return different
results, although the change of the R file is not related to this,
e.g. when I add the commands 'print("abc")' or 'newVariable <- 123' to
an R file that even does not call the Fortran code. However, adding
empty lines or comments does NOT change the values returned by the
Fortran code. Different modifications of the R files lead to different
results but the same modification always leads to the same results
(hence, the results are perfectly reproducible). Since the Fortran
code does a non-linear optimization, (slightly) different results
(e.g. depending on starting values) could be expected. However, the
values passed to the Fortran code are not affected by the
modifications that alter the values returned by the Fortran code and I
cannot sea any connection between the modification of the R files and
the values returned by the Fortran code. Could this phenomenon be
caused by an error in the Fortran code, by a bug in R, or is this a
usual behavior that an expert would expect in this situation? Any
hints are welcome!

Arne

[1] http://r-forge.r-project.org/projects/frontier/

-- 
Arne Henningsen
http://www.arne-henningsen.name



[Rd] Fortran routine affected by unrelated R code
Arne Henningsen