From oliver at first.in-berlin.de  Wed Jan  7 20:50:13 2009
From: oliver at first.in-berlin.de (oliver at first.in-berlin.de)
Date: Wed,  7 Jan 2009 20:50:13 +0100 (CET)
Subject: [Rd] Parse-Error creates strange function calls (completely
	different printouts) (PR#13436)
Message-ID: <20090107195013.70AFE282EFC1@mail.pubhealth.ku.dk>

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



[Rd] Parse-Error creates strange function calls (completely different printouts) (PR#13436)
oliver at first.in-berlin.de