install.packages 中的警告:将 NULL 指针转换为 R NULL

Warning in install.packages: converting NULL pointer to R NULL

我刚刚升级到 R 4.0.0,现在我正在尝试重新安装我使用的包。但是当我尝试在 RStudio 中这样做时,我收到以下警告:

Warning in install.packages: converting NULL pointer to R NULL

我后来在 运行 一个闪亮的应用程序时也收到了这种警告:

Warning in .Call("rs_registerShinyFunction", params): converting NULL pointer to R NULL

这是从哪里来的?我该如何解决?

如果需要:

> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=fr_FR.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=fr_FR.UTF-8        LC_COLLATE=fr_FR.UTF-8    
 [5] LC_MONETARY=fr_FR.UTF-8    LC_MESSAGES=fr_FR.UTF-8   
 [7] LC_PAPER=fr_FR.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] shiny_1.4.0.2     hammer_0.0.0.9000 testthat_2.3.2   

loaded via a namespace (and not attached):
 [1] xfun_0.13         remotes_2.1.1     shinyjs_1.1       purrr_0.3.4      
 [5] miniUI_0.1.1.1    htmltools_0.4.0   usethis_1.6.1     yaml_2.2.1       
 [9] rlang_0.4.6       pkgbuild_1.0.8    later_1.0.0       glue_1.4.0       
[13] withr_2.2.0       stringr_1.4.0     htmlwidgets_1.5.1 knitr_1.28       
[17] callr_3.4.3       fastmap_1.0.1     golem_0.2.1       httpuv_1.5.2     
[21] ps_1.3.3          fansi_0.4.1       Rcpp_1.0.4.6      xtable_1.8-4     
[25] promises_1.1.0    backports_1.1.6   DT_0.13           shinyhelper_0.3.2
[29] desc_1.2.0        pkgload_1.0.2     jsonlite_1.6.1    config_0.3       
[33] mime_0.9          fs_1.4.1          packrat_0.5.0     digest_0.6.25    
[37] stringi_1.4.6     processx_3.4.2    stargazer_5.2.2   rprojroot_1.3-2  
[41] here_0.1          cli_2.0.2         tools_4.0.0       dockerfiler_0.1.3
[45] magrittr_1.5      crayon_1.3.4      xml2_1.3.2        prettyunits_1.1.1
[49] shinyBS_0.61      attempt_0.3.1     assertthat_0.2.1  roxygen2_7.1.0   
[53] rstudioapi_0.11   R6_2.4.1          compiler_4.0.0   

这个source建议安装

的包
Rscript -e 'install.packages(...)'

在命令行而不是 RStudio 上。这似乎是 RStudio 特有的东西。

更新到最新的 Rstudio 版本(至少 1.2.5042)修复了这个问题。它在 Github 的 this 问题中被注意到。

为避免与新的 R 主要版本不兼容,重新安装所有软件包可能是个好主意:

installed <- installed.packages()[,1]
install.packages(installed)