依次加载 Data.Table 和 dplyr 会出错
Loading Data.Table and dplyr one after other gives errors
我运行遇到一个以前没遇到过的问题。当我单独加载 data.table 包(版本 1.9.4),然后尝试对数据集进行子集化以删除变量时,我没有遇到任何问题。但是,当我也加载 plyr(版本 1.8.2) 和 dplyr(版本 0.4.1) 时,出现以下错误(已尝试玩具数据集也一样)。请注意,原始文件位于 Excel 中,我使用 library(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)
输入文件已损坏,对于在论坛上发帖深表歉意。我没有收到任何关于文件损坏的警告,运行 另一个玩具数据集给出了完全相同的错误。
我运行遇到一个以前没遇到过的问题。当我单独加载 data.table 包(版本 1.9.4),然后尝试对数据集进行子集化以删除变量时,我没有遇到任何问题。但是,当我也加载 plyr(版本 1.8.2) 和 dplyr(版本 0.4.1) 时,出现以下错误(已尝试玩具数据集也一样)。请注意,原始文件位于 Excel 中,我使用 library(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)
输入文件已损坏,对于在论坛上发帖深表歉意。我没有收到任何关于文件损坏的警告,运行 另一个玩具数据集给出了完全相同的错误。