[R-SIG-Mac] Re: [R] Cocoa GUI: pasting in R Console yields syntax error

Rob J Goedman goedman at mac.com
Mon Dec 6 17:07:44 CET 2004


Hi Anthony and David,

Can we please move this discussion to R-SIG-Mac. Most R GUI questions 
are posted on that list.

Is it possible either of you send me a copy of a file with the weird 
characters in it. Just a few
lines should do it. Early on we had a few of these issues with non-Unix 
terminated lines
in editors, e.g. MAC lines are typically CR terminated, or Window lines 
are terminated
by CRLF. But Simon solved all of these a while ago.

Which version of R are you using (2.0.1 from CRAN or the nightly build 
from Rosuda)?

Thanks,
Rob

On Dec 6, 2004, at 1:23 AM, David Enot wrote:

> Anthony
>
> I faced the same problem and it took me some time to spot the origin: 
> I have no clue where it can come from!( I suspect this happened when I 
> moved from 1.9.0 to 2.0.0, OS X 1.3...). I know that the built in R 
> editor is very handy: what I do is a "more myfile.r" on the terminal 
> to check if there are weird characters and then delete then directly 
> with the R editor. Not very efficient I reckon: OS X gurus may have 
> another solution!
>
>   David
>
>
> On 6 Dec 2004, at 08:33, Anthony Westerling wrote:
>
>> 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
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide! 
>> http://www.R-project.org/posting-guide.html
>>
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html



More information about the R-SIG-Mac mailing list