根据另一个数据集的标准排除数据集中的多个试验

时间:2016-04-26 09:41:01

标签: r

我有两个不同长度的数据集,其中一个包含我需要在另一个中排除试验的信息(条件)。数据集b对于一个试验具有多个值,对于该试验,数据集仅具有一个条件值,例如:

数据集a:

subj    trial   condition   
  1       1        2
  1       2        2
  1       3        3
  1       4        1
  1       5        4

数据集b:

subj    trial    value
  1       1       488  
  1       1       626 
  1       1       449
  1       1       813
  ...
  1       4       564
  1       4       763
  1       4       346
  1       4       545

我想排除b中的所有试验,其中条件== 1 in a。所以在这个例子中,我想摆脱b中试验4的所有值。

我理解这一点:

exclude <- b[b$condition == 1] 
data <- a[a$trial != exclude$trial]
由于两个数据集的长度不同,

无法完成。如何告诉R排除数据集b的所有试验倍数?

1 个答案:

答案 0 :(得分:1)

我们可以使用ubuntu@ubuntu-VirtualBox:/dev/libjingle$ gclient config http://libjingle.googlecode.com/svn/trunk depot_tools update failed. Conflict in /dev/webrtc/depot_tools Cannot rebase: You have unstaged changes. Please commit or stash them. Traceback (most recent call last): File "/dev/webrtc/depot_tools/gclient.py", line 2333, in <module> sys.exit(main(sys.argv[1:])) File "/dev/webrtc/depot_tools/gclient.py", line 2319, in main return dispatcher.execute(OptionParser(), argv) File "/dev/webrtc/depot_tools/subcommand.py", line 252, in execute return command(parser, args[1:]) File "/dev/webrtc/depot_tools/gclient.py", line 1911, in CMDconfig client.SaveConfig() File "/dev/webrtc/depot_tools/gclient.py", line 1295, in SaveConfig self.config_content) File "/dev/webrtc/depot_tools/gclient_utils.py", line 142, in FileWrite with codecs.open(filename, mode=mode, encoding='utf-8') as f: File "/usr/lib/python2.7/codecs.py", line 884, in open file = __builtin__.open(filename, mode, buffering) IOError: [Errno 13] Permission denied: './.gclient'

%in%