Pergunta

I am trying to generate notes for the reports package https://github.com/trinker/reports/ , and followed the steps from the youtube video http://goo.gl/x9ulf0 . I did run the chunk Tyler has there http://goo.gl/XHouuc but when I try to generate the notes i keep getting the following error message:

> notes()
Error in value[[3L]](cond) : 

Possible causes:

1) The main file directory is not set as the working directory
2) ~/ARTICLES/notes.xlsx or ~/ARTICLES/notes.csv does not exist

I then tried to set my working directory to different places and even to move the ARTICLES directory to my home ~ directory, but i keep getting the exact same message no matter where i place the wd. i read the source code for the notes function but couldn't figure out where the problem might be. the notes2 function also gives me the same error

here is my sessioninfo:

> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] knitcitations_0.4-7  bibtex_0.3-6         knitr_1.4.1          slidifyLibraries_0.3
[5] slidify_0.3.52       reports_0.2.0       

loaded via a namespace (and not attached):
 [1] digest_0.6.3   evaluate_0.4.7 formatR_0.9    httr_0.2       markdown_0.6.3
 [6] RCurl_1.95-4.1 rJava_0.9-4    stringr_0.6.2  tools_3.0.1    whisker_0.3-2 
[11] xlsx_0.5.1     xlsxjars_0.5.0 XML_3.95-0.2   xtable_1.7-1   yaml_2.1.8    

any thoughts on what the problem might be?

Foi útil?

Solução

@Ricardo Pietrobon Thank you for bringing this to my attention.

Ok the problem is that the xlsx package relies on Depends and not Imports to load the call to .jnew from the rJava package. This means if you have used library(xlsx) then read.xlsx works fine, however if only the read.xlsx is attached via namespace then rJava's .jnew is not called. hence the error. This is confirmed in that the NAMESPAE file for xlsx contains:

import("xlsxjars")    
exportPattern("^[^\\.]")

This became a problem because CRAN recently required more restrictive checks and I started using importFrom rather than import and relying on Depends. I actually recieved a warning along these lines from Prof. Brian Ripley about relying on Depends. At the time I didn't understand it but heeded it. I now get exactly what he was talking about.

For the time being I have added rJava to the Depends field in the DESCRIPTION file. This throws a NOTE in the CRAN check as I'm Depending but not importing and needs to be removed after xlsx is updated.

I opened an issue with the xlsx package in the link below regarding the problem. Hopefully this gets fixed and uploaded soon. In the mean time notes() should be operating fine.

https://code.google.com/p/rexcel/issues/detail?id=24&thanks=24&ts=1379267751

I opened an issue at report's GitHub concerning this and as I believe the original problem has been solved, further conversation can be directed there.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top