Bug 15495 - Unhelpful error message when building package (‘x’ must be an atomic vector)
Unhelpful error message when building package (‘x’ must be an atomic vector)
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Misc
R-devel (trunk)
All All
: P3 minor
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-18 20:09 UTC by Dan Tenenbaum
Modified: 2013-10-20 12:35 UTC (History)
2 users (show)

See Also:


Attachments
a test package - building it reproduces the issue (4.74 KB, application/x-gzip)
2013-10-20 01:07 UTC, Dan Tenenbaum
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Tenenbaum 2013-10-18 20:09:28 UTC
When building many different packages, vignette building fails with the error:
‘x’ must be an atomic vector

That is not the 'real' error. I can find out the 'real error by installing the package, Stangling the vignette, and sourcing it. It would be nice if R CMD build would produce the real error so I did not have to do that.

Example, the RDAVIDWebService package from Bioconductor:

svn co --username readonly --password readonly \
https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/RDAVIDWebService

$ R CMD build RDAVIDWebService
[...]
Error: processing vignette ‘RDavidWS-vignette.Rnw’ failed with diagnostics:
‘x’ must be an atomic vector
Execution halted

When I install the package, stangle and source the vignette, the actual error is:

Error in .checkKeysAreWellFormed(keys) : 
  keys must be supplied in a character vector with no NAs
In addition: Warning message:
In Ops.factor(funChart$PValue, pvalueCutoff) : < not meaningful for factors

It would be great if R CMD build would produce that.
Comment 1 Duncan Murdoch 2013-10-19 13:29:52 UTC
Could you please put together a simpler example?  That package is huge, and has lots of dependencies.  A simple fake package that triggers the same error would make debugging a lot easier.
Comment 2 Duncan Murdoch 2013-10-19 13:39:39 UTC
Meant to add:  When I make such a small package, I don't see that message:

$ Rcmd build testpkg
* checking for file 'testpkg/DESCRIPTION' ... OK
* preparing 'testpkg':
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... ERROR

Error: processing vignette 'small.Rnw' failed with diagnostics:
 chunk 1
Error in eval(expr, envir, enclos) : object 'foobar' not found
Execution halted
Comment 3 Dan Tenenbaum 2013-10-20 01:07:18 UTC
Created attachment 1497 [details]
a test package - building it reproduces the issue
Comment 4 Dan Tenenbaum 2013-10-20 01:08:52 UTC
OK, here is a scaled down version of the package with no dependencies and no code. 
to reproduce the issue, download it and

tar zxf thefile
R CMD build RDAVIDWebService

results in:

* checking for file 'RDAVIDWebService/DESCRIPTION' ... OK
* preparing 'RDAVIDWebService':
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... ERROR
Warning in eval(expr, envir, enclos) : 0

Error: processing vignette 'RDavidWS-vignette.Rnw' failed with diagnostics:
'x' must be an atomic vector
Execution halted

Thanks,
Dan
Comment 5 Dan Tenenbaum 2013-10-20 01:13:03 UTC
Slicing up the vignette even more, the problem goes away (that is, the correct error is shown) when I comment out this line:

\SweaveOpts{concordance=TRUE}

Dan
Comment 6 Duncan Murdoch 2013-10-20 12:35:24 UTC
Thanks for the example.  It's now fixed in R-devel and R-patched.