Roxygen警告“无法打开连接” “权限被拒绝”;

Roxygen警告“无法打开连接” “权限被拒绝”;

问题描述:

我正在使用roxygen2,由于某种原因我无法使其运行。

我已经尝试过:

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

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

结果是:

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还尝试过:

> roxygen2::roxygenise()

收益:

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

我尝试安装6.1.0和6.0.1版本的roxygen,结果相同。
有什么解决方案吗?谢谢。

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  


就此,即使在使用上述解决方案并更新到 roxygen2 (7.0.1)的最新版本,我一直遇到相同的错误。经过一些调试后,我发现在函数之一中,函数文档中有一个空的#’行。省略空行后,便可以对函数进行充氧并创建文档。希望这会有所帮助!

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!