From ripley at stats.ox.ac.uk  Tue Feb  8 18:36:02 2011
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 8 Feb 2011 17:36:02 +0000 (GMT)
Subject: [Rd] bug in codetools/R CMD check?
In-Reply-To: <189791.22034.qm@web29519.mail.ird.yahoo.com>
References: <189791.22034.qm@web29519.mail.ird.yahoo.com>
Message-ID: <alpine.LFD.2.02.1102081730560.12643@gannet.stats.ox.ac.uk>

On Tue, 8 Feb 2011, Hin-Tak Leung wrote:

> --- On Tue, 8/2/11, luke-tierney at uiowa.edu <luke-tierney at uiowa.edu> wrote:
>
>> From: luke-tierney at uiowa.edu <luke-tierney at uiowa.edu>
>> Subject: Re: [Rd] bug in codetools/R CMD check?
>> To: "Hin-Tak Leung" <htl10 at users.sourceforge.net>
>> Cc: david.clayton at cimr.cam.ac.uk, r-devel at r-project.org
>> Date: Tuesday, 8 February, 2011, 15:34
>> Thanks -- will try to have a look
>> sometime soon.
>>
>> luke
>
>
> Thanks.
>
> Also, regardless of whether that's a bug in codetools or snpMatrix 
> (I am okay if you turn this around to say there is some coding style 
> we shouldn't do in there, for which I'd apologize), there seems to 
> be a small bug or inconsistency, and certainly in R or codetools, in 
> that the codetools message is shown in all 4 platforms - linux, mac, 
> win32, win64 - but the error status, whether it is correct or not, 
> only propagate back up to the "R CMD check" harness in the case of 
> win64 and not for the other 3 platforms. It should pass or fail with 
> a warning consistently on all platforms.

Are you sure this is the same version of R and codetools?  If you mean 
BioC's check farm, that often has version skew.  I see the message 
consistently on all my platforms ....

>
> Hin-Tak
>
>> On Thu, 3 Feb 2011, Hin-Tak Leung wrote:
>>
>>> Hi Mr Tierney,
>>>
>>> I have noticed an error message from R 1.12.x's CMD
>> check for a while (apparently prof Ripley completely rewrote
>> CMD check in R 1.12+)
>>> e.g.:
>>> http://bioconductor.org/checkResults/2.7/bioc-LATEST/snpMatrix/lamb2-checksrc.html
>>>
>>> ----------------
>>> * checking R code for possible problems ... NOTE
>>> Warning: non-unique value when setting 'row.names':
>> ?new?
>>> Error in `row.names<-.data.frame`(`*tmp*`, value =
>> c("1", "new", "new" :
>>> ? duplicate 'row.names' are not allowed
>>> Calls: <Anonymous> ... rownames<- ->
>> row.names<- -> row.names<-.data.frame
>>> Execution halted
>>> -----------------
>>>
>>> yet everything is okey dokey at http://bioconductor.org/checkResults/2.7/bioc-LATEST/#S
>> under the snpMatrix entry.
>>>
>>> I believe it might be a bug in
>> codetools::incLocalSrcInfo (used by "R CMD check") and here
>> is what I think the fix(?) - but I am not entirely sure what
>> that routine does and why other package writers haven't
>> noticed similiar problems before:
>>>
>>> diff -ur codetools/R/codetools.R
>> codetools-fix/R/codetools.R
>>> --- codetools/R/codetools.R???
>> 2011-01-07 15:52:58.000000000 +0000
>>> +++ codetools-fix/R/codetools.R???
>> 2011-02-03 10:03:54.000000000 +0000
>>> @@ -823,8 +823,9 @@
>>> ? ???new <- list(srcfile = if
>> (is.null(w$srcfile)) NA_character_ else w$srcfile,
>>> ? ? ? ? ? ? ?
>> ???frow = if (is.null(w$frow)) NA_integer_
>> else w$frow,
>>> ? ? ? ? ? ? ?
>> ???lrow = if (is.null(w$lrow)) NA_integer_
>> else w$lrow)
>>> +? ? new <- as.data.frame(new,
>> stringsAsFactors = FALSE)
>>> ? ???if (is.null(value))
>>> -? ? ? ? value <-
>> as.data.frame(new, stringsAsFactors = FALSE)
>>> +? ? ? ? value <- new
>>> ? ???else
>>> ? ? ? ???value <-
>> rbind(value, new)
>>> ? ???assign("srcinfo", value,
>> entry)
>>>
>>>
>>> Apply this "fix" would result in snpMatrix's "R CMD
>> check" churning out:
>>>
>>> ---------------------
>>> .ld.withmany: local variable ?names.components?
>> assigned but may not be used
>>> .ld.withmany: local variable ?nsnps.for.each?
>> assigned but may not be used
>>> misinherits: local variable ?nc.snps? assigned but
>> may not be used
>>> misinherits: local variable ?nr.snps? assigned but
>> may not be used
>>> qq.chisq: local variable ?lab? assigned but may
>> not be used
>>> read.HapMap.data: local variable ?base? assigned
>> but may not be used
>>> read.HapMap.data: local variable ?build? assigned
>> but may not be used
>>> read.HapMap.data: local variable ?finish? assigned
>> but may not be used
>>> read.HapMap.data: local variable ?strand? assigned
>> but may not be used
>>> tdt.snp: local variable ?nc.snps? assigned but may
>> not be used
>>> tdt.snp: local variable ?nr.snps? assigned but may
>> not be used
>>> ---------------------
>>>
>>> which is more like expected check warnings.
>>>
>>> Care to comment?
>>>
>>> Hin-Tak Leung
>>>
>>>
>>>
>>>
>>> ______________________________________________
>>> R-devel at r-project.org
>> mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>> --
>> Luke Tierney
>> Statistics and Actuarial Science
>> Ralph E. Wareham Professor of Mathematical Sciences
>> University of Iowa? ? ? ? ? ?
>> ? ? ? Phone:? ? ? ?
>> ? ???319-335-3386
>> Department of Statistics and? ? ? ?
>> Fax:? ? ? ? ? ?
>> ???319-335-3017
>> ? ? Actuarial Science
>> 241 Schaeffer Hall? ? ? ? ? ?
>> ? ? ? email:? ? ? luke at stat.uiowa.edu
>> Iowa City, IA 52242? ? ? ? ?
>> ? ? ???WWW:? http://www.stat.uiowa.edu
>
>
>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] bug in codetools/R CMD check?
Prof Brian Ripley