result_create(conn @ ptr,statement)中的错误:没有这样的列:b.ret

时间:2018-09-21 14:48:45

标签: r

data_processed <- sqldf(" select a.permno, a.number, a.mean, b.ret as med, a.std
                  from data_processed as a
                  left join data_processed2 as b
                  on a.permno=b.permno")

无法正常工作,请提供以下数据:

1)经过数据处理:

permno number         mean        std
1   10107    120 0.0117174000 0.06802718
2   11850    120 0.0024398083 0.04594591
3   12060    120 0.0005072167 0.08544500
4   12490    120 0.0063569167 0.05325215
5   14593    120 0.0200060583 0.08865493
6   19561    120 0.0154743500 0.07771348
7   25785    120 0.0184815583 0.16510082
8   27983    120 0.0025951333 0.09538822
9   55976    120 0.0092889000 0.04812975
10  59328    120 0.0098526167 0.07135423

2)data_processed2:

 permno     return

1 10107 0.0191920 2 11850 0.0015495 3 12060 -0.0040130 4 12490 0.0078245 5 14593 0.0231735 6 19561 0.0202610 7 25785 -0.0018760 8 27983 0.0027375 9 55976 0.0089435 10 59328 0.0166490

0 个答案:

没有答案