[R] Errors checking a library

michael watson (IAH-C) michael.watson at bbsrc.ac.uk
Thu Nov 18 14:52:33 CET 2004


Hi

I am writing an R library.  The documentation for one of my functions
includes an example that I *know* works - simply cut and paste into R on
either Windows and Linux and it works perfectly, no errors or warnings,
nothing, nyet.

However, when I run "R CMD check" on the library, I get an error.  I am
running R CMD check on linux, and the offending piece of code appears to
be:

cox[cox$group %in% onc,]

"cox" is a data frame, one of the columns of which is group, which
contains numbers.  "onc" is a vector of numbers.

The output on Linux from R CMD check is this:

> # lots of code
> # lots of code
>cox[cox$group
+
+
+ # the rest of my code
Error: syntax error
Execution halted

As can be seen, my code "cox[cox$group %in% onc,]" seems to have been
executed incorrectly.  Does R CMD check have a problem with the "%in%"
operator?  It would seem that R has somehow got mixed up and has lost
the rest of my command.

I'm using R 1.9.1 on Suse Linux 8.2.  The example code works fine on
both Windows and Linux when cut-and-pasted into an R window.

Mick




More information about the R-help mailing list