[Rd] bug in codetools/R CMD check?

luke-tierney at uiowa.edu luke-tierney at uiowa.edu
Tue Feb 8 16:34:04 CET 2011


Thanks -- will try to have a look sometime soon.

luke

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


More information about the R-devel mailing list