在RStudio中:';无法打开文件';-但是它';在那里

在RStudio中:';无法打开文件';-但是它';在那里,r,rstudio,R,Rstudio,我在尝试处理ggplot2中的“钻石”数据时遇到了问题(这是在尝试完成“R for data science”中的练习时)。我现在已经在64位Windows10笔记本电脑上重新安装了Rstudio(1.0.143)和R(3.4.0),并且有同样的问题。因此: > library("tidyverse", lib.loc="~/R/win-library/3.4") Loading tidyverse: ggplot2 Loading tidyverse: tibble Loading ti

我在尝试处理ggplot2中的“钻石”数据时遇到了问题(这是在尝试完成“R for data science”中的练习时)。我现在已经在64位Windows10笔记本电脑上重新安装了Rstudio(1.0.143)和R(3.4.0),并且有同样的问题。因此:

> library("tidyverse", lib.loc="~/R/win-library/3.4")
Loading tidyverse: ggplot2
Loading tidyverse: tibble
Loading tidyverse: tidyr
Loading tidyverse: readr
Loading tidyverse: purrr
Loading tidyverse: dplyr
Conflicts with tidy packages -------------------------------------------------
----------------------------------
filter(): dplyr, stats
lag():    dplyr, stats
> str(diamonds)
Error in str(diamonds) : 
  cannot open file '~/R/win-library/3.4/ggplot2/data/Rdata.rdb': No such file 
or directory
In addition: Warning messages:
1: In get(results[[i]], pos = which(search() == packages[[i]])) :
restarting interrupted promise evaluation
2: In str(diamonds) : restarting interrupted promise evaluation
但是“钻石”数据就在那里——如果我在R本身中使用相同的命令,在同一台机器上(库…str(钻石))我得到:

有什么想法吗?(关于stackoverflow的第一篇文章-如果您能提供任何关于礼仪的提示,我将不胜感激)


谢谢你,Chris

你提到你“在R本身”中得到了同样的结果。要明确的是,第一次尝试使用错误消息是在RStudio而不是R GUI中工作时?为什么要指定
lib.loc
?如果你只是写
library(tidyverse)
,会发生同样的情况吗?哦,当你说“R本身”时,你是指控制台吗?是的,我说的“R本身”是指控制台。我通过勾选RStudio中显示的包列表中的框来加载tidyverse-这就是lib.loc在lib命令中的方式。
Classes ‘tbl_df’, ‘tbl’ and 'data.frame':       53940 obs. of  10 variables:
 $ carat  : num  0.23 0.21 0.23 0.29 0.31 0.24 0.24 0.26 0.22 0.23 ...
 $ cut    : Ord.fact    ..... etc