Dear R-developers, I am currently developing an R package called RLadyBug. When developing under Linux "R CMD check ." works fine without a warning. However, when I do "Rcmd check ." under Windows (version 2.4.0 and earlier) I get a ?syntax error" when checking the examples. This puzzles me somewhat, because a manual source("RLadyBug-Ex.R") on Windows works fine. On the other hand, a "Rterm.exe --no-save < RLadyBug-Ex.R" in a command shell under Windows reproduces the error. My first guess was that the very long line was causing the problem, but when I open RLadyBug-Ex.R in Emacs, change the coding system from "undecided-dos" to "undecided-unix" and save the file "Rterm.exe --no-save < RLadyBug-Ex.R" works fine.... Does anybody has an idea what is causing the error and how to fix this? Best regards, Michael H?hle -- --- * checking for working latex ... OK * using log directory 'z:/Transmission/RLadyBug/..Rcheck' * using R version 2.4.0 (2006-10-03) * checking for file './DESCRIPTION' ... OK * checking extension type ... Package * this is package 'RLadyBug' version '0.4-1' * checking package dependencies ... OK * checking if this is a source package ... OK * checking whether package 'RLadyBug' can be installed ... OK * checking package directory ... OK * checking for portable file names ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for syntax errors ... OK * checking R files for non-ASCII characters ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the name space can be loaded with stated dependencies ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * creating RLadyBug-Ex.R ... OK * checking examples ... ERROR Running examples in 'RLadyBug-Ex.R' failed. The error most likely occurred in:> ### * LBExperiment-class > > flush(stderr()); flush(stdout()) > > ### Name: LBExperiment-class > ### Title: Class "LBExperiment" > ### Aliases: LBExperiment-class show,LBExperiment-method > ### plot,LBExperiment-method plot,LBExperiment,missing-method > ### summary,LBExperiment-method data2events,LBExperiment-method > ### data2events > ### Keywords: classes > > ### ** Examples > > sim.layout <- new( "LBLayout", S0=matrix( c( 13, rep( 14, 7 ) ), ncol=4 ),+ E0=matrix( c( 1, rep( 0, 7 ) ), ncol=4 ) )> sim.opts <- new( "LBOptions", seed=2006,+ LBmodel=c( "gamma", "gamma", "gamma", FALSE ), + ignoreData=c( FALSE, FALSE, FALSE ), + initBeta =list( init=0.125, + gamma=0.001, delta=0.001 ), + initBetaN=list( init=0.018, + gamma=0.001, delta=0.001 ), + initIncu=list( asis=FALSE, const=FALSE, + g=6.697, g.gamma=0.001, g.delta=0.001, + d=0.84, d.gamma=0.001,d.delta=0.001 ), + initInf=list( 1.772, 0.001, 0.001, 0.123, 0.001, 0.001 ), + initDia=list( 149.126, 0.001, 0.001, + 8.737, 0.001, 0.001 ) ) Error: syntax error in: "a=list( 149.126, 0.001, 0.001, " 8.737, 0.001, 0.001 ) ) Execution halted
On 10/31/2006 8:38 AM, Michael Hoehle wrote:> Dear R-developers, > > I am currently developing an R package called RLadyBug. When > developing under Linux "R CMD check ." works fine without a warning. > However, when I do "Rcmd check ." under Windows (version 2.4.0 and > earlier) I get a ?syntax error" when checking the examples. > > This puzzles me somewhat, because a manual source("RLadyBug-Ex.R") on > Windows works fine. On the other hand, a "Rterm.exe --no-save < > RLadyBug-Ex.R" in a command shell under Windows reproduces the error. > My first guess was that the very long line was causing the problem, > but when I open RLadyBug-Ex.R in Emacs, change the coding system from > "undecided-dos" to "undecided-unix" and save the file "Rterm.exe > --no-save < RLadyBug-Ex.R" works fine.... > > Does anybody has an idea what is causing the error and how to fix this?No. Could you send me the RLadyBug-Ex.R file? I'd like to get an exact copy of what you have, so please put it in a .zip or other archive. If you use .zip, you'll need to rename it when mailing (or just put it on a web page somewhere), because our mail server doesn't accept emailed .zip files. Duncan Murdoch> > Best regards, > > Michael H?hle > > -- > > --- > * checking for working latex ... OK > * using log directory 'z:/Transmission/RLadyBug/..Rcheck' > * using R version 2.4.0 (2006-10-03) > * checking for file './DESCRIPTION' ... OK > * checking extension type ... Package > * this is package 'RLadyBug' version '0.4-1' > * checking package dependencies ... OK > * checking if this is a source package ... OK > * checking whether package 'RLadyBug' can be installed ... OK > * checking package directory ... OK > * checking for portable file names ... OK > * checking DESCRIPTION meta-information ... OK > * checking top-level files ... OK > * checking index information ... OK > * checking package subdirectories ... OK > * checking R files for syntax errors ... OK > * checking R files for non-ASCII characters ... OK > * checking whether the package can be loaded ... OK > * checking whether the package can be loaded with stated dependencies ... OK > * checking whether the name space can be loaded with stated dependencies ... OK > * checking S3 generic/method consistency ... OK > * checking replacement functions ... OK > * checking foreign function calls ... OK > * checking R code for possible problems ... OK > * checking Rd files ... OK > * checking Rd cross-references ... OK > * checking for missing documentation entries ... OK > * checking for code/documentation mismatches ... OK > * checking Rd \usage sections ... OK > * creating RLadyBug-Ex.R ... OK > * checking examples ... ERROR > Running examples in 'RLadyBug-Ex.R' failed. > The error most likely occurred in: > >> ### * LBExperiment-class >> >> flush(stderr()); flush(stdout()) >> >> ### Name: LBExperiment-class >> ### Title: Class "LBExperiment" >> ### Aliases: LBExperiment-class show,LBExperiment-method >> ### plot,LBExperiment-method plot,LBExperiment,missing-method >> ### summary,LBExperiment-method data2events,LBExperiment-method >> ### data2events >> ### Keywords: classes >> >> ### ** Examples >> >> sim.layout <- new( "LBLayout", S0=matrix( c( 13, rep( 14, 7 ) ), ncol=4 ), > + E0=matrix( c( 1, rep( 0, 7 ) ), ncol=4 ) ) >> sim.opts <- new( "LBOptions", seed=2006, > + LBmodel=c( "gamma", "gamma", "gamma", FALSE ), > + ignoreData=c( FALSE, FALSE, FALSE ), > + initBeta =list( init=0.125, > + gamma=0.001, delta=0.001 ), > + initBetaN=list( init=0.018, > + gamma=0.001, delta=0.001 ), > + initIncu=list( asis=FALSE, const=FALSE, > + g=6.697, g.gamma=0.001, g.delta=0.001, > + d=0.84, d.gamma=0.001,d.delta=0.001 ), > + initInf=list( 1.772, 0.001, 0.001, > 0.123, 0.001, 0.001 ), > + initDia=list( 149.126, 0.001, 0.001, > + 8.737, 0.001, 0.001 ) ) > Error: syntax error in: > "a=list( 149.126, 0.001, 0.001, > " 8.737, 0.001, 0.001 ) ) > Execution haltedIs there a closing parenthesis not shown? Because they don't balance in that expression.
"Michael Hoehle" <michael.hoehle at gmail.com> writes:> Dear R-developers, > > I am currently developing an R package called RLadyBug. When > developing under Linux "R CMD check ." works fine without a warning. > However, when I do "Rcmd check ." under Windows (version 2.4.0 and > earlier) I get a ??syntax error" when checking the examples. > > This puzzles me somewhat, because a manual source("RLadyBug-Ex.R") on > Windows works fine. On the other hand, a "Rterm.exe --no-save < > RLadyBug-Ex.R" in a command shell under Windows reproduces the error. > My first guess was that the very long line was causing the problem, > but when I open RLadyBug-Ex.R in Emacs, change the coding system from > "undecided-dos" to "undecided-unix" and save the file "Rterm.exe > --no-save < RLadyBug-Ex.R" works fine.... > > Does anybody has an idea what is causing the error and how to fix this? > > Best regards, > > Michael H?hle....> > sim.opts <- new( "LBOptions", seed=2006, > + LBmodel=c( "gamma", "gamma", "gamma", FALSE ), > + ignoreData=c( FALSE, FALSE, FALSE ), > + initBeta =list( init=0.125, > + gamma=0.001, delta=0.001 ), > + initBetaN=list( init=0.018, > + gamma=0.001, delta=0.001 ), > + initIncu=list( asis=FALSE, const=FALSE, > + g=6.697, g.gamma=0.001, g.delta=0.001, > + d=0.84, d.gamma=0.001,d.delta=0.001 ), > + initInf=list( 1.772, 0.001, 0.001, > 0.123, 0.001, 0.001 ), > + initDia=list( 149.126, 0.001, 0.001, > + 8.737, 0.001, 0.001 ) ) > Error: syntax error in: > "a=list( 149.126, 0.001, 0.001, > " 8.737, 0.001, 0.001 ) ) > Execution halted.... It's a longshot, but could some funny characters have crept in around "initDia"?? (There's a way to open it in Hex from inside Emacs, isn't there?) -- O__ ---- Peter Dalgaard ??ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
On 10/31/2006 8:38 AM, Michael Hoehle wrote:> Dear R-developers, > > I am currently developing an R package called RLadyBug. When > developing under Linux "R CMD check ." works fine without a warning. > However, when I do "Rcmd check ." under Windows (version 2.4.0 and > earlier) I get a ?syntax error" when checking the examples.Thanks for pointing me to the source. I can reproduce the problem, and I'm fairly sure it's an R bug, not a problem in your source. I need to trace through at a low level to confirm this and to work out the fix. Duncan Murdoch
On 10/31/2006 2:07 PM, Duncan Murdoch wrote:> On 10/31/2006 1:50 PM, Michael Hoehle wrote: >>> Thanks for pointing me to the source. I can reproduce the problem, and >>> I'm fairly sure it's an R bug, not a problem in your source. I need to >>> trace through at a low level to confirm this and to work out the fix. >>> >> >> It reassuring to know that the problem appears not to be with my code. >> Thanks for your help so far and hopefully you are able to find the >> bug! Let me know when you know more. >> >> Michael >> >> P.S. When I do a dos2unix on RLadyBug-Ex.R "Rterm --no-save < >> RLadyBug-Ex.R " works fine. > > Yes, the problem has to do with the CR LF line ends in the file. For > some reason R switches from handling those properly to not doing so. > The problem I'm having right now is that I can't do input redirection in > gdb in Windows, so it's really hard to see when the switch happens, or why.I'm now fairly sure this isn't an R bug after all. It goes away if I edit out the requirement in RLadyBug for rJava, which makes me think that rJava is somehow messing up R's input routines. (Rcmd check fails later when it can't find ".jnew", as you'd expect. But there's no spurious syntax error.) Because of the difficulties with the debugger I'm going to quit now; if you find any evidence that suggests it really is R's bug after all, please let me know. Simon, let me know if there are any tests I can do to help track this down. Duncan Murdoch