目前,我有16383,43维数据。看起来是这样的:
Response0me ReleaseDate date MicrosoftWindows PlayStation4 ………
Prison Architect 2015-10-06 0:00 2015-10-07 0:00 2015-10-06 0:00 2016-06-28 0:00
Prison Architect 2015-10-06 0:00 2015-10-08 0:00 2015-10-06 0:00 2016-06-28 0:00
Prison Architect 2015-10-06 0:00 2015-10-09 0:00 2015-10-06 0:00 2016-06-28 0:00
TIS-100 2015-07-20 0:00 2015-07-21 0:00 2015-07-20 0:00
TIS-100 2015-07-20 0:00 2015-07-22 0:00 2015-07-20 0:00
TIS-100 2015-07-20 0:00 2015-07-23 0:00 2015-07-20 0:00正如您所看到的,对于每个Response0me,有一个ReleaseDate, MicrosoftWindows, PlayStation4,等等,但是有许多date。所以我想看看这个数据集如下:
Response0me ReleaseDate MicrosoftWindows
Prison Architect 2015-10-06 0:00 2015-10-06 0:00
TIS-100 2015-07-20 0:00 简而言之,我想要删除(实际上不是删除或删除,但只是不显示在我的控制台上)无意义的数据,然后缩略行,只看到选定的数据。我有办法做得到吗?
发布于 2018-11-30 03:29:17
你可以用unique(df[, -3])。最后的-3将取消选择date变量(位于第三位),只剩下不经常更改的变量。之后,unique将删除重复的观测结果。如果要排除更多变量,可以执行unique(df[, c(3, ...)])。
另外,您可以使用dplyr:
df %>% select(-date) %>% distinct()
https://stackoverflow.com/questions/53550765
复制相似问题