[R] Cocoa GUI: pasting in R Console yields syntax error

Anthony Westerling leroy at ucsd.edu
Mon Dec 6 09:33:59 CET 2004


I've recently upgraded to R-2.0.1 on a Mac running OS X 10.3+

I am using the new Cocoa-based GUI.  Everything was working well for a 
while.  In the middle of an R session, I started "suddenly" to have a 
problem where code copied from an open editor window and pasted into 
the R Console gives a syntax error.  It doesn't matter what the code 
is.  If the same exact text is typed into the console directly, I get 
no errors.

I tried quitting the R session and restarting.  The problem did not go 
away.

I tried using a different editor, instead of the built-in editor.  
After opening the file with my R code in it in AlphaX instead of the 
built-in editor, I could see that the text typed most recently ( ie, 
since the problem started) had a character that looked like an open 
square or box at the start of most lines.  I deleted these and can't 
see any other extraneous symbols in AlphaX.  However, I still get 
syntax errors when trying to paste code that was originally typed in 
using the built-in editor.  If I retype the same thing in the same file 
using AlphaX, one line below the original, then copy and paste into the 
R console, it executes without generating syntax errors.

So, it looks like something odd is going on with the built-in editor?

Anthony Westerling




More information about the R-help mailing list