[Bioc-devel] R CMD check RNAither, error LiWongRank

Seth Falcon sfalcon at fhcrc.org
Tue Mar 30 21:34:10 CEST 2010

Hi Nora,

On 3/30/10 2:03 AM, RNAither at gmx.de wrote:
> I have checked the LiWongRank function manually and it works without
> any problem. The problem seems to be that the function needs user
> input to work. Here's the code of the example that is failing:

> data(exampleHeader, package="RNAither")
> data(exampleDataset, package="RNAither")

> However, the "0.5" does not seem to get acknowledged during the check
> any more (it definitely did before), which is why NA is taken as a
> value, which yields an error later in the function. Is there some way
> around this?

Examples that require user input should not be run during automated 
testing.  One way to avoid this is to wrap the example code in an if 
block like this:

    if (interactive()) {
        # code here that needs user input

But I wonder if you can provide a means of specifying the required input 
all at once when the function is called?  There is considerable benefit 
in having code in your package executed during R CMD check so that its 
functionality is continuously and automatically getting some verification.

To make this suggestion concrete, could you add some additional optional 
argument to LiWongRank so it might look like:

    LiWongRank <- function(header, dataset, list("SigIntensity", 
"GeneName", v1=NULL, v2=NULL, v3=NULL, v4=NULL) { ...}

Then the call in the example could be:

 > normres<- LiWongRank(header, dataset, list("SigIntensity", 
"GeneName"), 0.5, 3, 2, 3)

The code could determine whether these arguments had been provided and 
if not, query the user for additional input.

+ seth

Seth Falcon
Bioconductor Core Team | FHCRC

More information about the Bioc-devel mailing list