在R中,我有两个具有相同字段名Key
和Value
的数据表。
Table A
+----------+-------+
| Key | Value |
+----------+-------+
| 20170910 | 10.11 |
+----------+-------+
| 20170911 | 12.21 |
+----------+-------+
| 20170915 | 15.51 |
+----------+-------+
| 20170916 | 33.01 |
+----------+-------+
| 20170912 | 82.2 |
+----------+-------+
| 20170913 | 11.22 |
+----------+-------+
| 20170914 | 2.33 |
+----------+-------+
Table B
+----------+-------+
| Key | Value |
+----------+-------+
| 20170912 | 3.5 |
+----------+-------+
| 20170913 | 13.2 |
+----------+-------+
| 20170914 | 31.1 |
+----------+-------+
| 20170916 | 33.01 |
+----------+-------+
| 20170910 | 33.11 |
+----------+-------+
| 20170911 | 9.21 |
+----------+-------+
| 20170915 | 52.1 |
+----------+-------+
我需要做的是将Value
的{{1}}元素与Table A
的{{1}}元素相乘Value
。有没有更好的方法在数据表中执行此操作而不是迭代检查
如果迭代完成,它就像这样
Table B