Hi All-

I have noticed a curious phenomenon since upgrading to R 2.15.2. I can't even 
consistently replicate the problem, but I will describe it as best as possible. 
I get "ghost text" in my R console echoing the names of variables that I am 
returning from functions. This occurs even when I am not calling the function 
but is observed simply after loading the functions into my workspace via 
source(....). Suppose I have a file "myFunctions.R", with a function like this:

myFunction <- function(){
        obj <- doSomething()
        class(obj) <- 'SomeClass'
        return(obj)
}

Upon sourcing the file (with source(...)), and sometimes upon executing the 
function itself, I sometimes (but not consistently) observe background gray 
text in console like this:

>source('myFunctions.R')
obj  > 

where "obj" is printed in gray (but this color is presumably dependent on R 
preferences...in any event, it is clearly distinct from font colors associated 
with printed return values, command line input, and error/warning messages). 
And sometimes when I execute the function (in a simulation or otherwise), I can 
get long streams of this that appear to be echoing the local (within-function) 
name of the returned variable, e.g.:

> source('mySimulationScript.R') # run a script file that iteratively calls 
> myFunction(..)
obj 
obj
obj
obj
obj
obj
obj
obj
obj
obj  > ## the next R prompt: note displacement to right of phantom "obj" text

This looks identical to the screen text you can observe in an R console when 
running system commands with system(...), e.g., echoing terminal output to R 
console. 

Again, I can't even consistently replicate this. But I only observe the issue 
with R 2.15.2 (running the same code on R 2.15.1 does not lead to this 
behavior). I'm running R 2.15.2 on OSX 10.7.5:

> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_2.15.2

~Dan Rabosky

_____________________
Dan Rabosky
Assistant Professor
Dept of Ecology and Evolutionary Biology
& Museum of Zoology
University of Michigan

_______________________________________________
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to