错误包网格没有名称空间 [英] Error package grid does not have a namespace

查看:416
本文介绍了错误包网格没有名称空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在工作PC上使用RStudio 0.99.903中的R.3.3.1.

I'm using R.3.3.1 in RStudio 0.99.903 on a work PC.

尝试同时使用ggplot2和tidytext时出现相同的错误消息:尽管我设法安装了这两个软件包,但在启动它们时却收到此错误消息:

I'm having the same error message when trying to use both ggplot2 and tidytext: although I managed to install both packages, when i launch them i get this error message:

Error : package ‘grid’ does not have a namespace

起初我以为这意味着网格丢失了,但是我读到它现在是基础的一部分,所以我不明白为什么我在运行library(grid)时为什么不加载...这让我感到困惑,这是事实我只能在我的软件包列表中看到gridBase和gridExtra,而不能看到grid.并且当我尝试使用library(gridBase)时,我还会收到相同的错误:包'grid'没有命名空间"消息.

At first i thought this meant grid was missing but i read that it's now part of base so i don't understand why it doesn't load when i run library(grid)... Adding to my confusion is the fact that i can only see gridBase and gridExtra in my list of packages, not grid. And when i try library(gridBase) i also get the same "Error : package ‘grid’ does not have a namespace" message.

这是我的会话信息:

sessionInfo() R版本3.3.1(2016-06-21) 平台:x86_64-w64-mingw32/x64(64位) 在以下环境中运行:Windows 7 x64(内部版本7601)Service Pack 1

sessionInfo() R version 3.3.1 (2016-06-21) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United     Kingdom.1252    LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252    

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

other attached packages:
[1] stringr_1.0.0   tidyr_0.5.1     scales_0.4.0    lubridate_1.5.6 purrr_0.2.2     dplyr_0.5.0    

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.6      assertthat_0.1   R6_2.1.2         plyr_1.8.4       DBI_0.4-1        magrittr_1.5     stringi_1.1.1   
 [8] lazyeval_0.2.0   tools_3.3.1      munsell_0.4.3    colorspace_1.2-6 tibble_1.1   

我在网上到处寻找并尝试了各种方法(使用旧版本的R,在我的RStudio全局选项中更改默认CRAN,取消选中使用Internet Explorer库代理",从R中删除并重新安装软件包, RStudio,GUI和Shell ...),但无济于事...

i've looked everywhere online and tried various approaches (using an older version of R, changing the default CRAN in my RStudio global options, unticking "use internet explorer library proxy", remove and re-install the packages from R not RStudio, both GUI and Shell...) but nothing works...

推荐答案

在卸载我以为我没有使用的软件包后,这发生在我身上. 网格"是Rstudio的程序包"窗口中列出的程序包,我连同大约20个其他程序一起将其删除.没有网格"阻止加载"ggplot2",从而阻止加载"rstan".

This happened to me after unloading packages that I thought I was not using. "Grid" was a package listed in the Packages window in Rstudio and I deleted it along with about 20 others. Not having "grid" prevented loading "ggplot2" which in turn prevented loading "rstan".

我通过重新安装R来恢复,假定这种基本软件包必须是基本安装的一部分,因为它不在CRAN上.重新安装后,与网格"有关的错误消失了,但现在将包"scales"标识为丢失. 秤"位于CRAN上,易于加载. library(ggplot2)似乎再次正常工作.

I recovered by reinstalling R, presuming that such a fundamental package must be part of the base install since it was not on CRAN. After reinstall, the error related to "grid" disappeared, but the package "scales" was now identified as missing. "Scales" was on CRAN and easily loaded. library(ggplot2) appear to be working again.

这篇关于错误包网格没有名称空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆