[R] bug Rcmdr

Duncan Murdoch murdoch at stats.uwo.ca
Fri Jan 4 19:15:56 CET 2008


On 1/4/2008 12:25 PM, John Fox wrote:
> Dear Richard and Jeremy,
> 
> I suspect this is coming from how assignments are handled, and may be hard
> to fix. I'll take a look.
> 
> Oddly, I can't duplicate this error when the commands are entered on a
> single line separated by semicolons; then I get the error message
> 
> 	unexpected ';' in "withVisible( a <- 2;"
> 
> both under Windows and Ubuntu (R 2.6.1, Rcmdr 2.3-10 in both OSes).

This happens because you're wrapping the expression in withVisible(), 
then parsing it.  If you add braces it should be fine, i.e. wrap in

"withVisible({", "})"

so that you end up executing

withVisible({ a<- 2; a <- a+5; a })

instead of the syntax error

withVisible( a<- 2; a <- a+5; a )

I've sent more on the double evaluation problem privately.

Duncan Murdoch

> 
> Thanks for the information. I'll see what I can do.
> 
> John
> 
> --------------------------------
> John Fox, Professor
> Department of Sociology
> McMaster University
> Hamilton, Ontario, Canada L8S 4M4
> 905-525-9140x23604
> http://socserv.mcmaster.ca/jfox
> 
> 
>> -----Original Message-----
>> From: Richard M. Heiberger [mailto:rmh at temple.edu]
>> Sent: January-04-08 11:58 AM
>> To: 'John Fox'; jeremy.mazet at soredab.org
>> Cc: r-help at r-project.org
>> Subject: RE: [R] bug Rcmdr
>> 
>> John,
>> 
>> It's worse than a semi-colon problem.  It is an error in a self-
>> referential
>> statement 'a <- a+5'.  Type those lines as three separate lines in the
>> Rcmdr
>> Script Window
>> and you still get the wrong answer.  This is from 1.3-9.
>> 
>> > a<-2
>> 
>> > a<-a+5
>> 
>> > a
>> [1] 12
>> 
>> Rich
>> 
>> 
>> 
>> 
>> 
>> -----Original Message-----
>> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
>> project.org] On
>> Behalf Of John Fox
>> Sent: Friday, January 04, 2008 08:47 AM
>> To: jeremy.mazet at soredab.org
>> Cc: r-help at r-project.org
>> Subject: Re: [R] bug Rcmdr
>> 
>> Dear Jeremy,
>> 
>> As it says in ?Commander, the script window in the R Commander doesn't
>> provide a true console to R. One of the things it doesn't do is handle
>> lines
>> with multiple commands separated by semicolons. In fact, I wonder what
>> version of the Rcmdr package you're using, since (for me) in the latest
>> version on CRAN (1.3-10), lines with semi-colons produce an error.
>> 
>> I'll take a look at this problem when I have a chance, and accommodate
>> semi-colons if I can do so reasonably. I don't think that it should be
>> too
>> hard.
>> 
>> Regards,
>>  John
>> 
>> --------------------------------
>> John Fox, Professor
>> Department of Sociology
>> McMaster University
>> Hamilton, Ontario, Canada L8S 4M4
>> 905-525-9140x23604
>> http://socserv.mcmaster.ca/jfox
>> 
>> 
>> > -----Original Message-----
>> > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
>> > project.org] On Behalf Of jeremy.mazet at soredab.org
>> > Sent: January-04-08 6:14 AM
>> > To: r-help at r-project.org
>> > Subject: [R] bug Rcmdr
>> >
>> > Hello,
>> >
>> > If I run the script : "a<-2 ; a<-a+5 ; a"  whith the "submit" buton
>> in
>> > Rcmdr the result is 12 !!!
>> > But if I run the script "a<-2 ; b<-a+5 ; b" there is no problem and
>> the
>> > result is 7.
>> >
>> > I think there is a bug in the function "onSubmit".
>> >
>> > Thanks,
>> > 	[[alternative HTML version deleted]]
>> >
>> > ______________________________________________
>> > R-help at r-project.org mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide http://www.R-project.org/posting-
>> > guide.html
>> > and provide commented, minimal, self-contained, reproducible code.
>> 
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-
>> guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list