[Rd] Error: cannot set length of non-vector

Peter Dalgaard p.dalgaard at biostat.ku.dk
Mon Apr 4 13:23:28 CEST 2005


Kurt Hornik <Kurt.Hornik at wu-wien.ac.at> writes:

> stack info at the C level to actually see where in the code the error
> triggers.  If I add debugging info prior to the error call, the error is
> gone.
> 
> Btw, if I comment *output* redirection in tools::checkVignettes(), the
> error is gone as well.
> 
> Note that this is *NOT* an error thrown by R CMD check.  The failure
> occurs when checkVignettes() is running the code (via source()) of the
> .R files created via Stangle(), and all the info we have about the error
> is being passed on.

Aha, so *that's* how to reproduce it. 

One thing that catches my eye is that 
tools::checkVignettes has

    outConn <- textConnection("out", "w")
    sink(outConn, type = "output")
    sink(outConn, type = "message")
....
           for (f in rfiles) {
            yy <- try(source(f))

and demo.R does extensive manipulation of an object called "out".

Perhaps it helps to do something like local(source(f, local=TRUE))? Or
maybe put local=TRUE in the textConnection() call.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907



More information about the R-devel mailing list