R:“ sp”包在打开RStudio时加载,没有明显原因

时间:2018-07-19 21:54:03

标签: r rstudio startup

我正在一个项目中进行工作,该项目涉及许多非常大的文件,其中一些是原始数据,一些中间结果。仅在一台相当快的计算机上加载所有这些文件,就需要20分钟。结果,我没有像以前那样频繁地重建工作区。

每当我打开RStudio时,甚至在触摸键盘之前,第一件事就是

Loading required package: sp

我也不知道为什么。尽管sp是由我稍后加载的其他软件包加载的,但是这种早期加载有时会引起问题。例如,当sp版本更改时,由于不加载R,因此无法更新我的软件包。当我尝试使用detach()卸载并重新安装更新的版本时,出现了lazy-load database is corrupt错误。

在我看来,问题几乎必须存在于我的.Rprofile.Rprofile.site文件中。我已经确定了我的R_HOMEHOME和工作目录,如下所示:

R.home()

用于安装R的目录:C:/PROGRA~1/R/R-35~1.0

path.expand("~")

用户的主目录:D:/ Documents和

getwd()

对于当前工作目录:D:/ Documents / R / middle_class

尽管过去我有更多活动的.Rprofile文件,但是这些位置中只有一个包含当前内容:.Rprofile.site中的C:\Program Files\R\R-3.5.0\etc包含一个.Rprofile.site文件,如果该会话是交互式的,并且我刚刚添加的Renviron.site文件将我的HOME目录从D:/Document重置为D:/Documents/R

加载sp的命令还从哪里来?

我的会话信息在下面

> sessionInfo()
R version 3.5.0 (2018-04-23)
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    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
 [1] ggthemes_3.5.0         viridis_0.5.1          viridisLite_0.3.0      RColorBrewer_1.1-2     prettydoc_0.2.1       
 [6] cartogram_0.1.0        rgdal_1.3-3            maptools_0.9-2         maps_3.3.0             DiagrammeR_1.0.0      
[11] DependenciesGraphs_0.3 XML_3.98-1.12          shinydashboard_0.7.0   visNetwork_2.0.4       ipumsr_0.2.0          
[16] pracma_2.1.4           GB2_2.1                survey_3.33-2          Matrix_1.2-14          devtools_1.13.6       
[21] reprex_0.2.0           installr_0.20.0        broom_0.5.0            Hmisc_4.1-1            Formula_1.2-3         
[26] survival_2.41-3        lattice_0.20-35        haven_1.1.2            feather_0.3.1          magrittr_1.5          
[31] rlang_0.2.1            pryr_0.1.4             forcats_0.3.0          stringr_1.3.1          dplyr_0.7.6           
[36] purrr_0.2.5            readr_1.1.1            tidyr_0.8.1            tibble_1.4.2           ggplot2_3.0.0         
[41] tidyverse_1.2.1        sp_1.3-1              

loaded via a namespace (and not attached):
 [1] cubature_1.4        colorspace_1.3-2    class_7.3-14        rprojroot_1.3-2     htmlTable_1.12     
 [6] base64enc_0.1-3     rstudioapi_0.7      lubridate_1.7.4     xml2_1.2.0          codetools_0.2-15   
[11] splines_3.5.0       knitr_1.20          zeallot_0.1.0       rlist_0.4.6.1       jsonlite_1.5       
[16] cluster_2.0.7-1     rgeos_0.3-28        compiler_3.5.0      httr_1.3.1          backports_1.1.2    
[21] assertthat_0.2.0    lazyeval_0.2.1      cli_1.0.0           acepack_1.4.1       htmltools_0.3.6    
[26] tools_3.5.0         bindrcpp_0.2.2      igraph_1.2.1        gtable_0.2.0        glue_1.2.0         
[31] Rcpp_0.12.17        cellranger_1.1.0    rgexf_0.15.3        nlme_3.1-137        laeken_0.4.6       
[36] rvest_0.3.2         hypergeo_1.2-13     MASS_7.3-49         scales_0.5.0        hms_0.4.2          
[41] yaml_2.1.19         memoise_1.1.0       gridExtra_2.3       downloader_0.4      rpart_4.1-13       
[46] latticeExtra_0.6-28 stringi_1.1.7       Rook_1.1-1          mvbutils_2.7.4.1    e1071_1.6-8        
[51] checkmate_1.8.5     contfrac_1.1-12     boot_1.3-20         spData_0.2.9.0      pkgconfig_2.0.1    
[56] evaluate_0.11       bindr_0.1.1         sf_0.6-3            htmlwidgets_1.2     tidyselect_0.2.4   
[61] deSolve_1.21        plyr_1.8.4          R6_2.2.2            DBI_1.0.0           pillar_1.3.0       
[66] foreign_0.8-70      withr_2.1.2         units_0.6-0         nnet_7.3-12         modelr_0.1.2       
[71] crayon_1.3.4        rmarkdown_1.10      readxl_1.1.0        data.table_1.11.4   influenceR_0.1.0   
[76] digest_0.6.15       classInt_0.2-3      numDeriv_2016.8-1   brew_1.0-6          elliptic_1.3-7     
[81] munsell_0.5.0

0 个答案:

没有答案