[Rd] R CMD check: "..." used in a situation where it does not exist

2015-01-14 Thread Michal Burda
Dear R developers,

when running R CMD check, the R Under development (unstable)
(2015-01-13 r67453) gives me the following NOTE:


cbind.fsets: possible error in list(...): ... used in a situation
where it does not exist


The file that causes this note contains:


cbind.fsets <- function(..., deparse.level = 1) {
dots <- list(...)

res <- NULL
resVars <- NULL
resSpecs <- NULL

for (i in seq_along(dots)) {
arg <- dots[[i]]
argName <- names(dots)[i]

if (!is.null(arg)) {
if (!is.fsets(arg)) {
stop("Function 'cbind.fsets' cannot bind arguments
that are not valid 'fsets' objects")
}
class(arg) <- setdiff(class(arg), 'fsets')
if (is.null(res)) {
resVars <- vars(arg)
resSpecs <- specs(arg)
res <- arg
} else {
resVarNames <- c(names(resVars), names(vars(arg)))
resVars <- c(resVars, vars(arg))
names(resVars) <- resVarNames

o1 <- matrix(0, nrow=nrow(resSpecs), ncol=ncol(specs(arg)))
o2 <- matrix(0, nrow=nrow(specs(arg)), ncol=ncol(resSpecs))
resSpecs <- rbind(cbind(resSpecs, o1),
  cbind(o2, specs(arg)))
colnames(resSpecs) <- names(resVars)
rownames(resSpecs) <- names(resVars)
res <- cbind(res, arg)
}
}
}

return(fsets(res, resVars, resSpecs))
}



I want to avoid any NOTES prior submitting my package to CRAN, but I
cannot find any information what is wrong with my code and how to get
rid of that message during R CMD check process.

Does anybody of you know what is wrong with my code?

Thank you, in advance.



Best regards,


Michal Burda
junior researcher


IT4Innovations NSC
Institute for Research and Applications of Fuzzy Modeling   |
University of Ostrava   |   IT4Innovations National Supercomputing
Center
30. dubna 22   |   701 03  Ostrava   |   Czech Republic
e-mail: michal.bu...@osu.cz  |   web IRAFM: irafm.osu.cz  |   web
IT4I: it4i.cz  |   phone: +420 597 09 1450

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Is the tcltk failure in affylmGUI related to R bug 15957

2015-01-14 Thread Keith Satterley
I maintain the package affylmGUI. It works when installed on many 
previous versions of R. I have today tested exactly the same code under 
R-2.15.3, R-3.0.2, R-3.1.0, R-3.1.1, R-3.1.2 and R-devel.


I have also tested the versions of affylmGUI downloaded by biocLite for 
each version of R and the same result applies.


I have no errors under 2.15.3, 3.0.2, 3.1.0 and 3.1.1. The following 
error occurs under 3.1.2 and R-devel.


I run affylmGUI and read a targets file which then causes affylmGUI to 
read the specified cel files. On attempting to display the RNA targets 
file in a Tk window using the "RNA Targets" option from the "RNA 
Targets" Menu item and the following errors occur:


Error text box 1: Error in eval(substitute(expr),enclos):could not find 
function "<-"   - pressed OK
Following error text box: Error in paste("::RTcl",n,sep=""): object 'n' 
not found   - pressed OK
Following error text box: Error in assign(name, NULL, environ = I$env): 
object 'name' not found   - pressed OK
Following error text box: Error in paste("set",name, "(0,0)\"\"",sep= 
""):object 'name' not found   - pressed OK


This then results in an unfilled Tk window.

I am testing on a Windows 7, 64 bit environment. My sessionInfo is:

R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 
LC_MONETARY=English_Australia.1252

[4] LC_NUMERIC=C LC_TIME=English_Australia.1252
attached base packages:
 [1] stats4parallel  tcltk stats graphics  grDevices 
utils datasets  methods   base

other attached packages:
 [1] affylmGUI_1.40.0  AnnotationDbi_1.28.1 GenomeInfoDb_1.2.4
IRanges_2.0.1 S4Vectors_0.4.0
 [6] xtable_1.7-4  R2HTML_2.3.1 affyPLM_1.42.0
preprocessCore_1.28.0 gcrma_2.38.0
[11] tkrplot_0.0-23affyio_1.34.0 BiocInstaller_1.16.1  
affy_1.44.0   Biobase_2.26.0

[16] BiocGenerics_0.12.1   limma_3.22.3
loaded via a namespace (and not attached):
[1] Biostrings_2.34.1 DBI_0.3.1 RSQLite_1.0.0 splines_3.1.2 
XVector_0.6.0 zlibbioc_1.12.0


I think the relevant code that is resulting in the error is generated by 
this function in main.R:

tclArrayVar <- function(){
Try(n <- evalq(TclVarCount <- TclVarCount + 1, .TkRoot$env))
Try(name <- paste("::RTcl", n,sep = ""))
Try(l <- list(env = new.env()))
Try(assign(name, NULL, envir = l$env))
Try(reg.finalizer(l$env, function(env) tcl("unset", ls(env
Try(class(l) <- "tclArrayVar")
Try(.Tcl(paste("set ",name,"(0,0) \"\"",sep="")))
l  ### Investigate this line KS
} #end of tclArrayVar <- function()

This code is lines 877-886 in main.R

Despite the un-investigated last line in this function, it works fine in 
earlier versions of R as described above.


The original programmer has left our division some years ago and I have 
maintained the code since then. Consequently my understandings as to why 
the code was written the way it was is somewhat limited, so I have not 
touched anything unless it was broken.


My question is, do I need to do something with the affylmGUI code? I'd 
appreciate some advice if so.


Is this failure related to bug 15957 
(https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15957) that Duncan 
fixed on 2014-09-08.


cheers,

Keith
==
Keith Satterley
Bioinformatics Division
The Walter & Eliza Hall Institute of Medical Research
Melbourne, Victoria, Australia
==


__
The information in this email is confidential and intend...{{dropped:4}}

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] R CMD check: "..." used in a situation where it does not exist

2015-01-14 Thread Hadley Wickham
I think this is bug in R CMD check code.  I get a similar error:

rule: possible error in paste0(...): ... used in a situation where it
  does not exist

for the simple:

rule <- function(..., pad = "-") {
  if (nargs() == 0) {
title <- ""
  } else {
title <- paste0(...)
  }
  width <- getOption("width") - nchar(title) - 1
  message(title, " ", paste(rep(pad, width, collapse = "")))
}

where ... clearly does exist.

I skimmed the commits for the last couple of days - the most relevant
would seem to be this one by Michael Lawrence:
https://github.com/wch/r-source/commit/d3a42dabccb23462aa1e0a1edad00450f0a6131c
(but I might've missed others - many of the commit messages are not
terribly explanatory)

Hadley

On Wed, Jan 14, 2015 at 1:42 AM, Michal Burda  wrote:
> Dear R developers,
>
> when running R CMD check, the R Under development (unstable)
> (2015-01-13 r67453) gives me the following NOTE:
>
>
> cbind.fsets: possible error in list(...): ... used in a situation
> where it does not exist
>
>
> The file that causes this note contains:
>
>
> cbind.fsets <- function(..., deparse.level = 1) {
> dots <- list(...)
>
> res <- NULL
> resVars <- NULL
> resSpecs <- NULL
>
> for (i in seq_along(dots)) {
> arg <- dots[[i]]
> argName <- names(dots)[i]
>
> if (!is.null(arg)) {
> if (!is.fsets(arg)) {
> stop("Function 'cbind.fsets' cannot bind arguments
> that are not valid 'fsets' objects")
> }
> class(arg) <- setdiff(class(arg), 'fsets')
> if (is.null(res)) {
> resVars <- vars(arg)
> resSpecs <- specs(arg)
> res <- arg
> } else {
> resVarNames <- c(names(resVars), names(vars(arg)))
> resVars <- c(resVars, vars(arg))
> names(resVars) <- resVarNames
>
> o1 <- matrix(0, nrow=nrow(resSpecs), ncol=ncol(specs(arg)))
> o2 <- matrix(0, nrow=nrow(specs(arg)), ncol=ncol(resSpecs))
> resSpecs <- rbind(cbind(resSpecs, o1),
>   cbind(o2, specs(arg)))
> colnames(resSpecs) <- names(resVars)
> rownames(resSpecs) <- names(resVars)
> res <- cbind(res, arg)
> }
> }
> }
>
> return(fsets(res, resVars, resSpecs))
> }
>
>
>
> I want to avoid any NOTES prior submitting my package to CRAN, but I
> cannot find any information what is wrong with my code and how to get
> rid of that message during R CMD check process.
>
> Does anybody of you know what is wrong with my code?
>
> Thank you, in advance.
>
>
>
> Best regards,
>
>
> Michal Burda
> junior researcher
>
>
> IT4Innovations NSC
> Institute for Research and Applications of Fuzzy Modeling   |
> University of Ostrava   |   IT4Innovations National Supercomputing
> Center
> 30. dubna 22   |   701 03  Ostrava   |   Czech Republic
> e-mail: michal.bu...@osu.cz  |   web IRAFM: irafm.osu.cz  |   web
> IT4I: it4i.cz  |   phone: +420 597 09 1450
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
http://had.co.nz/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] R CMD check: "..." used in a situation where it does not exist

2015-01-14 Thread Duncan Murdoch
On 14/01/2015 4:47 AM, Hadley Wickham wrote:
> I think this is bug in R CMD check code.  I get a similar error:
> 
> rule: possible error in paste0(...): ... used in a situation where it
>   does not exist
> 
> for the simple:
> 
> rule <- function(..., pad = "-") {
>   if (nargs() == 0) {
> title <- ""
>   } else {
> title <- paste0(...)
>   }
>   width <- getOption("width") - nchar(title) - 1
>   message(title, " ", paste(rep(pad, width, collapse = "")))
> }
> 
> where ... clearly does exist.
> 
> I skimmed the commits for the last couple of days - the most relevant
> would seem to be this one by Michael Lawrence:
> https://github.com/wch/r-source/commit/d3a42dabccb23462aa1e0a1edad00450f0a6131c
> (but I might've missed others - many of the commit messages are not
> terribly explanatory)

Yes, it's a temporary bug in R-devel, not a problem in Michal's code.

Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Request for help with UBSAN and total absense of CRAN response

2015-01-14 Thread Martyn Plummer
On Tue, 2015-01-13 at 10:34 -0600, Dirk Eddelbuettel wrote:
> On 13 January 2015 at 08:21, Dan Tenenbaum wrote:
> | Where should the package source be downloaded from? I see it in CRAN (but 
> presumably the latest version that causes the issue is not yet downloadable) 
> and in github.
> 
> The "presumable" assumption is incorrect AFAIK. 
> 
> The error should presumably came up in both versions as annoylib.h did not
> change there.  Feel free to prove me wrong :) and just use whatever is 
> easiest.
> 
> Dirk

This is a curious case. 

Here is where the first error occurs:

Executing test function test01getNNsByVector  ... 
Breakpoint 1, 0x009c0440 in __ubsan_handle_out_of_bounds ()
(gdb) frame 1
#1  0x7fffe777935b in AnnoyIndex 
>::_get_all_nns (this=0x3a7e8f0, v=0x37d95d0, n=3, result=0x7ffee1e8)
at ../inst/include/annoylib.h:532
532 nns.insert(nns.end(), nd->children, 
&(nd->children[nd->n_descendants]));
(gdb) p nd->children
$48 = {0, 1}
(gdb) p nd->n_descendants
$49 = 3
(gdb) p nns
$50 = std::vector of length 0, capacity 0

So we are trying to insert 3 values from an array of length 2 into an
STL vector. 

Comments in the header file annoylib.h (lines 114-130) show that this is
a result of a "memory optimization". Small objects have a completely
different format but are allocated in the same memory. When the
optimization is used the array is deliberately allowed to overflow:

S children[2]; // Will possibly store more than 2
T v[1]; // We let this one overflow intentionally

A workaround is to turn off the optimization by reducing the threshold
for the alternate data format (_K) to such a low level that it is never
used (annoylib.h, line 259):

//_K = (sizeof(T) * f + sizeof(S) * 2) / sizeof(S);
_K = 2; //Turn off memory optimization

I think this is a case of "being too clever by half".

Martyn



---
This message and its attachments are strictly confidenti...{{dropped:8}}

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Is the tcltk failure in affylmGUI related to R bug 15957

2015-01-14 Thread peter dalgaard
Seems unlikely that that particular bug is involved. I seem to recall some 
change related to inadvertent variable capture in .TkRoot$env (?). At any rate, 
we currently have

> parent.env(.TkRoot$env)


which used to be

> parent.env(.TkRoot$env)


as a result, this won't work any more because R_EmptyEnv has no operators and 
functions in it:

> evalq(x <- 1, .TkRoot$env)
Error in eval(substitute(expr), envir, enclos) : 
  could not find function "<-"

and consequently, you conk out at

   Try(n <- evalq(TclVarCount <- TclVarCount + 1, .TkRoot$env))

which presumably needs to be recoded in the same way as the current code in 
tclVar():

> tclVar
function (init = "") 
{
n <- .TkRoot$env$TclVarCount <- .TkRoot$env$TclVarCount + 
1L
name <- paste0("::RTcl", n)
l <- list(env = new.env())
assign(name, NULL, envir = l$env)
reg.finalizer(l$env, function(env) tcl("unset", ls(env)))
class(l) <- "tclVar"
tclvalue(l) <- init
l
}

(The whole thing looks a bit odd: Your function clones a fair bit of tclVar, 
wrapping each line in Try() for no apparent reason (or?), with the apparent 
purpose of doing something that seems quite similar to what tclArray() already 
does...)

-pd


> On 14 Jan 2015, at 06:50 , Keith Satterley  wrote:
> 
> I maintain the package affylmGUI. It works when installed on many previous 
> versions of R. I have today tested exactly the same code under R-2.15.3, 
> R-3.0.2, R-3.1.0, R-3.1.1, R-3.1.2 and R-devel.
> 
> I have also tested the versions of affylmGUI downloaded by biocLite for each 
> version of R and the same result applies.
> 
> I have no errors under 2.15.3, 3.0.2, 3.1.0 and 3.1.1. The following error 
> occurs under 3.1.2 and R-devel.
> 
> I run affylmGUI and read a targets file which then causes affylmGUI to read 
> the specified cel files. On attempting to display the RNA targets file in a 
> Tk window using the "RNA Targets" option from the "RNA Targets" Menu item and 
> the following errors occur:
> 
> Error text box 1: Error in eval(substitute(expr),enclos):could not find 
> function "<-"   - pressed OK
> Following error text box: Error in paste("::RTcl",n,sep=""): object 'n' not 
> found   - pressed OK
> Following error text box: Error in assign(name, NULL, environ = I$env): 
> object 'name' not found   - pressed OK
> Following error text box: Error in paste("set",name, "(0,0)\"\"",sep= 
> ""):object 'name' not found   - pressed OK
> 
> This then results in an unfilled Tk window.
> 
> I am testing on a Windows 7, 64 bit environment. My sessionInfo is:
> 
> R version 3.1.2 (2014-10-31)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> locale:
> [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 
> LC_MONETARY=English_Australia.1252
> [4] LC_NUMERIC=C LC_TIME=English_Australia.1252
> attached base packages:
> [1] stats4parallel  tcltk stats graphics  grDevices utils 
> datasets  methods   base
> other attached packages:
> [1] affylmGUI_1.40.0  AnnotationDbi_1.28.1 GenomeInfoDb_1.2.4
> IRanges_2.0.1 S4Vectors_0.4.0
> [6] xtable_1.7-4  R2HTML_2.3.1 affyPLM_1.42.0
> preprocessCore_1.28.0 gcrma_2.38.0
> [11] tkrplot_0.0-23affyio_1.34.0 BiocInstaller_1.16.1  affy_1.44.0
>Biobase_2.26.0
> [16] BiocGenerics_0.12.1   limma_3.22.3
> loaded via a namespace (and not attached):
> [1] Biostrings_2.34.1 DBI_0.3.1 RSQLite_1.0.0 splines_3.1.2 
> XVector_0.6.0 zlibbioc_1.12.0
> 
> I think the relevant code that is resulting in the error is generated by this 
> function in main.R:
> tclArrayVar <- function(){
>Try(n <- evalq(TclVarCount <- TclVarCount + 1, .TkRoot$env))
>Try(name <- paste("::RTcl", n,sep = ""))
>Try(l <- list(env = new.env()))
>Try(assign(name, NULL, envir = l$env))
>Try(reg.finalizer(l$env, function(env) tcl("unset", ls(env
>Try(class(l) <- "tclArrayVar")
>Try(.Tcl(paste("set ",name,"(0,0) \"\"",sep="")))
>l  ### Investigate this line KS
> } #end of tclArrayVar <- function()
> 
> This code is lines 877-886 in main.R
> 
> Despite the un-investigated last line in this function, it works fine in 
> earlier versions of R as described above.
> 
> The original programmer has left our division some years ago and I have 
> maintained the code since then. Consequently my understandings as to why the 
> code was written the way it was is somewhat limited, so I have not touched 
> anything unless it was broken.
> 
> My question is, do I need to do something with the affylmGUI code? I'd 
> appreciate some advice if so.
> 
> Is this failure related to bug 15957 
> (https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15957) that Duncan 
> fixed on 2014-09-08.
> 
> cheers,
> 
> Keith
> ==
> Keith Satterley
> Bioinformatics Division
> The Walter & Eliza Hall Institute of Medical Research
> Melbourne, Victoria, Australia
> ==
> 
> 
> __

[Rd] R under deveoplment CMD check note " ... used in a situation where it does not exist"

2015-01-14 Thread Peter Langfelder
Hi all,

just installed the current version of R-devel (2015-01-13 r67453) from
CRAN. Package checking via CMD check suddenly prints a lot of notes
that complain of ... used in a situation where it does not exist. A
prototypical example is

fa = function(...)
{
  fb(...)
}

where fa and fb are defined and available functions.

I haven't seen this note before on my package, so something changed in
R-devel - did I miss something in the NEWS? I looked for something
relating to ... but didn't find anything relevant.

Thanks,

Peter

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] R under deveoplment CMD check note " ... used in a situation where it does not exist"

2015-01-14 Thread Peter Langfelder
Apologies... missed Michal's email and the discussion of the same topic.

Thanks,

Peter

On Wed, Jan 14, 2015 at 6:15 PM, Peter Langfelder
 wrote:
> Hi all,
>
> just installed the current version of R-devel (2015-01-13 r67453) from
> CRAN. Package checking via CMD check suddenly prints a lot of notes
> that complain of ... used in a situation where it does not exist. A
> prototypical example is
>
> fa = function(...)
> {
>   fb(...)
> }
>
> where fa and fb are defined and available functions.
>
> I haven't seen this note before on my package, so something changed in
> R-devel - did I miss something in the NEWS? I looked for something
> relating to ... but didn't find anything relevant.
>
> Thanks,
>
> Peter

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel