From murdoch at stats.uwo.ca  Thu Jan  8 12:25:24 2009
From: murdoch at stats.uwo.ca (murdoch at stats.uwo.ca)
Date: Thu,  8 Jan 2009 12:25:24 +0100 (CET)
Subject: [Rd] Parse-Error creates strange function calls
	(completely	different (PR#13438)
Message-ID: <20090108112525.468212834337@mail.pubhealth.ku.dk>

This is not a bug.  Read ?paste:  if you give it a vector, it will give 
you a vector result.  That's what you're seeing.

Duncan Murdoch

oliver at first.in-berlin.de wrote:
> 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
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] Parse-Error creates strange function calls (completely different (PR#13438)
murdoch at stats.uwo.ca