【问题标题】:Roxygen Warning "cannot open the connection" "Permission Denied"Roxygen 警告“无法打开连接”“权限被拒绝”
【发布时间】:2023-03-11 03:40:01
【问题描述】:

我正在使用 roxygen2,但由于某种原因,我无法让它运行。
我试过了:

> 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

我也试过了:

> 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,结果相同。 有什么解决办法吗?谢谢。

(注)以下是我的会话信息:

>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  

【问题讨论】:

  • 您是否检查了文件的权限?
  • 是的。我有管理权限。
  • 试试roxygenise(clean=TRUE)
  • 不行;相同的警告信息。

标签: r installation devtools roxygen2


【解决方案1】:

我遇到了类似的错误,更新包没有帮助。然后我发现我有一个空的@example 函数(我计划稍后添加示例)。我删除了该行,问题得到了解决。在我的情况下,空 #' 没有造成任何问题。

【讨论】:

    【解决方案2】:

    只是为了跟进这一点,即使在使用上述解决方案并更新到roxygen2 (7.0.1) 的最新版本之后,我仍然遇到同样的错误。经过一些调试,我发现在我的一个函数中,函数文档中有一个空的#' 行。一旦我省略了空行,我就可以运行 roxygenize 我的函数并创建文档。希望这会有所帮助!

    【讨论】:

      【解决方案3】:

      这似乎是最新 roxygen2 6.1.0 中的一个小错误。 请参阅https://github.com/klutometis/roxygen/issues/766,gustavdelius 通过devtools::install_github("gustavdelius/roxygen") 提供短期解决方案。

      我想这将在 roxygen2 的下一个版本中得到解决。

      【讨论】:

        猜你喜欢
        • 2012-07-07
        • 2021-11-17
        • 1970-01-01
        • 2019-06-29
        • 2015-05-21
        • 1970-01-01
        • 2012-01-27
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多