Roxygen Warning “cannot open the connection” “Permission Denied”

半城伤御伤魂 提交于 2019-12-23 22:23:27

问题


I'm working with roxygen2 and for some reason I can't get it to run.
I've tried:

> devtools::load_all()
> devtools::document()

which resulted in:

Updating xxxx documentation 
Loading xxxx
First time using roxygen2. Upgrading automatically... 
Writing NAMESPACE 
Error in file(con, "r") : cannot open the connection 
In addition: Warning message: In file(con, "r") :   cannot open file 
'C:\Users\xxxxxxx': Permission denied

I also tried:

> roxygen2::roxygenise()

yielding:

Loading xxxx
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open file 'C:\Users\xxxxxxxx': Permission denied

I've tried installing the 6.1.0 and 6.0.1 versions of roxygen, with same results. Any solutions? Thanks.

(Note) The following is the my Session Info:

>sessionInfo()

R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United 
States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] stringi_1.2.4   usethis_1.3.0   glue_1.3.0      git2r_0.23.0            
RCurl_1.95-4.11
[6] bitops_1.0-6    rlang_0.2.1     testthat_2.0.0  roxygen2_6.1.0  
devtools_1.13.6

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.18    digest_0.6.15   withr_2.1.2     commonmark_1.5  R6_2.2.2       
 [6] backports_1.1.2 magrittr_1.5    rstudioapi_0.7  xml2_1.2.0          
 tools_3.5.1    
[11] stringr_1.3.1   yaml_2.2.0      compiler_3.5.1  memoise_1.1.0  

回答1:


This appears to be a minor bug in latest roxygen2 6.1.0. See https://github.com/klutometis/roxygen/issues/766 with short term solution being offered by gustavdelius via devtools::install_github("gustavdelius/roxygen").

I imagine this will be resolved in next release of roxygen2.




回答2:


Just to follow-up on this, even after using the solution above and updating to the most updated version of roxygen2 (7.0.1) I kept getting the same error. After some debugging, I found that in one of my functions I had an empty #' line in the documentation of the function. Once I omitted the empty line, I was able to run roxygenize my functions and create the documentation. Hope this helps!



来源:https://stackoverflow.com/questions/51641469/roxygen-warning-cannot-open-the-connection-permission-denied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!