我遇到了一个我之前没有遇到过的问题。当我单独加载 data.table包(版本1.9.4),然后尝试将数据集子集化以删除变量时,我没有遇到任何问题。但是,当我加载 plyr(版本1.8.2)和 dplyr(版本0.4.1)时,我收到以下错误(尝试使用玩具数据集以及)。请注意,原始文件位于Excel中,我使用库(readxl)将文件读取为RData文件格式(文件 vahere.RData 可在此处使用(https://goo.gl/kzI5bD )。该文件为三个变量 - LINK_ID(数字),TMC(字符),MPORegion(字符)。我得到的错误是:
Error in `[.tbl_df`(x, r, vars, with = FALSE) :
unused argument (with = FALSE)
我以前不记得遇到过这个错误。如果有人对正在发生的事情有任何见解,我会非常感激。我在两台独立的机器(Windows 7)上尝试了它并得到了同样的错误。两台机器的Sys.Info如下:
Machine 1 - sysname "Windows", release "7 x64", version "build 7601, Service Pack 1", machine "x86-64"
Machine 2 - sysname "Windows", release "7 x64", version "build 7601, Service Pack 1", machine "x86-64"
以下是跑步的历史。
> library(data.table)
data.table 1.9.4 For help type: ?data.table
*** NB: by=.EACHI is now explicit. See README to restore previous behaviour.
> load("vahere.RData")
> vahere[is.na(vahere)] <- "RestofVA"
> vahere <- setDT(vahere)
>
> # Drop link id and identify unique tmc to region
> uniqtmcs <- subset(vahere,select=-c(1))
> library(plyr)
> library(dplyr)
Attaching package: ‘dplyr’
The following objects are masked from ‘package:plyr’:
arrange, count, desc, failwith, id,
mutate, rename, summarise, summarize
The following objects are masked from ‘package:data.table’:
between, last
The following object is masked from ‘package:stats’:
filter
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
> rm(vahere)
> load("vahere.RData")
> vahere[is.na(vahere)] <- "RestofVA"
> vahere <- setDT(vahere)
>
> # Drop link id and identify unique tmc to region
> uniqtmcs <- subset(vahere,select=-c(1))
Error in `[.tbl_df`(x, r, vars, with = FALSE) :
unused argument (with = FALSE)
答案 0 :(得分:0)
输入文件已损坏,我为在论坛上发帖而道歉。我没有得到关于文件被损坏的任何警告,并且与另一个玩具数据集一起运行给出了完全相同的错误。