我想加入数据表:
> (d1 <- data.table(k=1:3,v=letters[1:3],key="k"))
k v
1: 1 a
2: 2 b
3: 3 c
> (d2 <- data.table(k=2:4,v=LETTERS[2:4],key="k"))
k v
1: 2 B
2: 3 C
3: 4 D
> d1[d2]
k v i.v
1: 2 b B
2: 3 c C
3: 4 NA D
> d2[d1]
k v i.v
1: 1 NA a
2: 2 B b
3: 3 C c
我想要的是&#34; union&#34;最后两个连接:
k v i.v
1: 1 NA a
2: 2 B b
3: 3 C c
4: 4 D NA
谢谢!
答案 0 :(得分:2)
您可以使用$ uname -a
Linux sacapus 2.6.32-504.12.2.el6.x86_64 #1 SMP Wed Mar 11 22:03:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ python --version
Python 2.7.9
$ cat test.py
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--list1", "-l1", help="liste 1", metavar="THE_LIST")
args = parser.parse_args()
if args.list1:
print("list1:" + str(args.list1))
$ python test.py -l1 "abc -V def"
usage: test.py [-h] [--list1 THE_LIST]
test.py: error: unrecognized arguments: -V def
:
merge