Warning in install.packages: converting NULL pointer to R NULL
Asked Answered
D

2

7

I just upgraded to R 4.0.0 and I am now trying to reinstall the packages I use. But when I try to do so in RStudio, I have the following warning:

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

I also had this sort of warning later when running a shiny app:

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

Where does this come from? How can I fix it?

If needed:

> 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   
Democratic answered 9/5, 2020 at 15:54 Comment(0)
T
8

Updating to the last Rstudio version (at least 1.2.5042) fixes the problem. It was noticed in this issue on Github.

To avoid incompatibilities with the new R major version, it might be a good idea to reinstall all the packages with:

installed <- installed.packages()[,1]
install.packages(installed)
Tray answered 12/5, 2020 at 14:56 Comment(1)
Indeed, updating RStudio removes the warnings. ThanksDemocratic
B
0

This source recommends to install the packages with

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

on the command line instead of RStudio. It seems to be something RStudio-specific.

Bioastronautics answered 12/5, 2020 at 14:48 Comment(2)
okay, but I would like to continue to install packages through RStudio. Besides, do you think this will solve the message produced when I run a shiny app?Democratic
Did you try to reinstall Shiny with the command line and run it again?Bioastronautics

© 2022 - 2024 — McMap. All rights reserved.