BatchGetSymbols,如何操纵输出?环R

时间:2017-07-14 18:17:10

标签: r dataframe

使用BatchGetSymbols包之后,我得到了这个输出

    price.adjusted   ref.date ticker
1          150.25 2017-06-14     FB
2          149.80 2017-06-15     FB
3          150.64 2017-06-16     FB
4          152.87 2017-06-19     FB
5          152.25 2017-06-20     FB
6          153.91 2017-06-21     FB
7          153.40 2017-06-22     FB
8          155.07 2017-06-23     FB
9          153.59 2017-06-26     FB
10         150.58 2017-06-27     FB
11         153.24 2017-06-28     FB
12         151.04 2017-06-29     FB
13         150.98 2017-06-30     FB
14         148.43 2017-07-03     FB
15         150.34 2017-07-05     FB
16         148.82 2017-07-06     FB
17         151.44 2017-07-07     FB
18         153.50 2017-07-10     FB
19         155.27 2017-07-11     FB
20         158.90 2017-07-12     FB
21         159.26 2017-07-13     FB
22         145.16 2017-06-14   AAPL
23         144.29 2017-06-15   AAPL
24         142.27 2017-06-16   AAPL
25         146.34 2017-06-19   AAPL
26         145.01 2017-06-20   AAPL
27         145.87 2017-06-21   AAPL
28         145.63 2017-06-22   AAPL
29         146.28 2017-06-23   AAPL
30         145.82 2017-06-26   AAPL
31         143.73 2017-06-27   AAPL
32         145.83 2017-06-28   AAPL
33         143.68 2017-06-29   AAPL
34         144.02 2017-06-30   AAPL
35         143.50 2017-07-03   AAPL
36         144.09 2017-07-05   AAPL
37         142.73 2017-07-06   AAPL
38         144.18 2017-07-07   AAPL
39         145.06 2017-07-10   AAPL
40         145.53 2017-07-11   AAPL
41         145.74 2017-07-12   AAPL
42         147.77 2017-07-13   AAPL
43         153.81 2017-06-14    IBM
44         154.22 2017-06-15    IBM
45         155.38 2017-06-16    IBM
46         154.84 2017-06-19    IBM
47         154.95 2017-06-20    IBM
48         153.79 2017-06-21    IBM
49         154.40 2017-06-22    IBM
50         154.11 2017-06-23    IBM
51         155.23 2017-06-26    IBM
52         154.75 2017-06-27    IBM
53         155.32 2017-06-28    IBM
54         154.13 2017-06-29    IBM
55         153.83 2017-06-30    IBM
56         155.58 2017-07-03    IBM
57         153.67 2017-07-05    IBM
58         152.36 2017-07-06    IBM
59         152.94 2017-07-07    IBM
60         153.42 2017-07-10    IBM
61         153.19 2017-07-11    IBM
62         153.70 2017-07-12    IBM
63         153.63 2017-07-13    IBM

是否有可能获得这样的输出?我将使用超过2000股票,所以它必须自动超过这3股票

                  FB    AAPL    IBM
2017-06-15      149.80  149.80  149.80 
2017-06-16      150.64  150.64  150.64 
2017-06-19      152.87  152.87  152.87 
2017-06-20      152.25  152.25  152.25 
2017-06-21      153.91  153.91  153.91 
2017-06-22      153.40  153.40  153.40 
2017-06-23      155.07  155.07  155.07 
2017-06-26      153.59  153.59  153.59 
2017-06-27      150.58  150.58  150.58 
2017-06-28      153.24  153.24  153.24 
2017-06-29      151.04  151.04  151.04 
2017-06-30      150.98  150.98  150.98 
2017-07-03      148.43  148.43  148.43 
2017-07-05      150.34  150.34  150.34 
2017-07-06      148.82  148.82  148.82 
2017-07-07      151.44  151.44  151.44 
2017-07-10      153.50  153.50  153.50 
2017-07-11      155.27  155.27  155.27 
2017-07-12      158.90  158.90  158.90 
2017-07-13      159.26  159.26  159.26 
如果有人可以帮助我,那会很棒。

0 个答案:

没有答案