[R] Change in behavior of compare statement

From: Tomas Andersson <tomas.andersson_at_spotfire.com>
Date: Tue 20 Sep 2005 - 00:46:33 EST

Dear all,  

I have come across some Windows Script code which calls the
"file.exists" function in R to check for the existence of a particular
file on an R server. This is what the code looks like:  



                        // some useful code


            while (m_workspace.session.eval("file.exists(" + dataFile +

")") != "1");

It appears that the behavior of this code is different when used with R version 2.1.1 compared to R version 1.9.1. If the compare statement s is changed from  

            while (s != "1")


            while (s != "True")


            while !(s)  

the behavior of the code is the same with both versions of R.  

After reading the R documentation, I have not found any evidence that the original syntax (s != "1") is in any way recommended or supported (in version 2.1.1). Still, my questions are:  

  1. Is it possible that the syntax has been supported in older versions of R?
  2. Is the reason for the recent change in behavior known and documented anywhere?

I have been unable to find an answer to either question, so any information about this would be appreciated.  


T. Andersson

        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Sep 21 02:32:36 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 17:19:15 EST