加载Data.Table和dplyr一个接一个给出错误 [英] Loading Data.Table and dplyr one after other gives errors

查看:284
本文介绍了加载Data.Table和dplyr一个接一个给出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个我以前没有遇到的问题。当我加载 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(character)。我得到的错误是:

I ran into a problem that I have not encountered before. When I load the data.table package (version 1.9.4) alone, and then try to subset a dataset to remove a variable I get no issues. However, when I load plyr (version 1.8.2) and dplyr (version 0.4.1) as well, I get the following error (tried the same with a toy dataset as well). Note that the original file is in Excel and I use library(readxl) to read the file into a RData file format (the file,vahere.RData is available here (https://goo.gl/kzI5bD). The file as three variables - LINK_ID (numeric), TMC (character), MPORegion (character). The error I get is:

Error in `[.tbl_df`(x, r, vars, with = FALSE) : 
unused argument (with = FALSE)

如果任何人有任何洞察,我会真的很感激它,我试图在两个单独的机器(Windows 7),并得到相同的错误。两个机器的Sys.Info如下:

I don't remember encountering this error before. If anyone has any insights on what is going on I would really appreciate it. I tried it on two separate machines (Windows 7) and get the same error. The Sys.Info from both machines are below:

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) 


推荐答案

输入文件已损坏,论坛。我没有得到关于文件被损坏的任何警告和运行与另一个玩具数据集给出完全相同的错误。

The input file was corrupted and I apologize for posting on the forum. I did not get any warnings about the file being corrupted and running with another toy dataset gave the exact same error.

这篇关于加载Data.Table和dplyr一个接一个给出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆