为什么在data.frame中创建日期变量会导致无法在rstudio中扩展变量列表?

时间:2019-07-02 16:17:30

标签: r rstudio

当我使用lubridate创建日期变量时,无法在rstudio的全局环境窗格中展开变量列表。删除日期变量将取消此操作。

# load the storms dataset from dplyr
library(dplyr)
data(storms)

data.frame显示在rstudio的全局环境窗口中,带有一个蓝色的小按钮,单击该按钮将展开显示所有变量的data.frame。 (https://imgur.com/JUAzyf9

# create a date variable by combining the month, day and year variables using 
# lubridate's mdy() function
library(lubridate)
storms <- mutate(storms, Date = mdy(paste(month, day, year)))

现在小按钮消失了,无法扩展data.frame。如果data.frame先前已扩展,则它保持打开状态并且无法关闭。 (https://imgur.com/INhpwv7

您仍然可以单击data.frame名称作为调用View()的快捷方式,数据将在新选项卡中打开。

# remove the date variable from the data.frame
storms <- select(storms, -Date)

从data.frame中删除Date变量将返回蓝色的小按钮。这是怎么回事?

更新:我正在使用RStudio 1.2.1335版本。其他用户遇到了此问题:https://community.rstudio.com/t/environment-data-frames-expand-with-blue-arrow-but-tbl-dfs-dont/32566/20

0 个答案:

没有答案