[Rd] Parse-Error creates strange function calls (completely different printouts) (PR#13436)

oliver at first.in-berlin.de oliver at first.in-berlin.de
Wed Jan 7 20:50:13 CET 2009


Full_Name: Oliver Bandel
Version: R version 2.7.1 (2008-06-23)
OS: Linux (Debian Lenny)
Submission from: (NULL) (88.73.82.147)


Hello,

I have written a small R-script.
When I inserted one line of code, the behaviour was completely different!

Instead of just printing one line more to the output,
the complete call of the function in which this line was added,
is different, and instead of one such call, the function seems to be
called more than once!

I just added a line, which prints some data,
but then the printouts were completely different than
expected; and when commenting the new stuff out,
the OK-behaviour came back.


Here a diff of the code:

=====================================
oliver at siouxsie:~/R-BUG$ diff ok.R buggy.R 
64c64
<   res.txt <- paste(# "\n\n Anzahl der Messungen:", sample_times, "\n",
---
>   res.txt <- paste("\n\n Anzahl der Messungen:", sample_times, "\n",
oliver at siouxsie:~/R-BUG$ 
======================================

You see, I only wanted to print out a variable.


But the output is much bigger now:

**************************************
oliver at siouxsie:~/R-BUG$ wc -l LOG.*
 125 LOG.buggy
  50 LOG.ok
 175 insgesamt
oliver at siouxsie:~/R-BUG$ 
**************************************


The variable sample_times is just an array with some numbers:
######################################
> ls()
 [1] "anemo.freq"          "anemo.impulse_times" "anemo.T"            
 [4] "impulse_num"         "impuls.messreihe"    "make_one_sample_set"
 [7] "sample.dauer"        "sample.freq"         "sample_num"         
[10] "sample.T"            "sample_times"       
> sample_times
 [1] 0 1 2 3 4 5 6 7 8 9
> mode(sample_times)
[1] "numeric"
> class(sample_times)
[1] "numeric"
> 
######################################


So, the change in the code could not bring such a strange result!

I could provide the original code for you,
if you need it for testing.
Please send me email, if you need it.

Best,
   Oliver Bandel



More information about the R-devel mailing list