[R-SIG-Finance] getQuote problem with multiple symbols

G See gsee000 at gmail.com
Tue Mar 20 04:21:45 CET 2012


Hi Xian,

I have more of an observation than a solution.  "Float Shares" is what
is causing trouble; it returns more than 1 column of data.

Certainly not an ideal solution, but if you exclude "Float Shares"
from the call, it will work.

Also, the reason your first call failed is because there are 3 extra
NA columns for
> getQuote("AA", what=yahooQF("Float Shares"))
            Trade Time Float Shares NA  NA NA
AA 2012-03-19 04:00:00            1 65 286  0

But only 2 extra NA columns for the rest. For example,
> getQuote("AACC", what=yahooQF("Float Shares"))
              Trade Time Float Shares  NA NA
AACC 2012-03-19 04:00:00           14 847  0


HTH,
Garrett

On Mon, Mar 19, 2012 at 9:47 PM, Xian Li <xianli.analytics at gmail.com> wrote:
> Hi,
>
> I found getQuote returns different results while querying the same set of tickers but of different orders. Here's an example:
>
>> getQuote("AACC;AAC;AAME;AAN;AAON;AAPL;AAP;AA",what=yahooQF(c("Market Capitalization","EBITDA","P/E Ratio","Shares Owned","Short Ratio","Book Value", "Earnings/Share","Float Shares")))
> Error in `row.names<-.data.frame`(`*tmp*`, value = value) :
>  invalid 'row.names' length
>> getQuote("AA;AACC;AAC;AAME;AAN;AAON;AAPL;AAP",what=yahooQF(c("Market Capitalization","EBITDA","P/E Ratio","Shares Owned","Short Ratio","Book Value", "Earnings/Share","Float Shares")))
>              Trade Time Market Capitalization  EBITDA P/E Ratio Shares Owned
> AA   2012-03-19 04:00:00               11.301B  3.268B     19.16            -
> AACC 2012-03-19 04:00:00                138.1M   37.1M     12.31            -
> AAC  2012-03-13 12:26:00                 84.8M       0       N/A            -
> AAME 2012-03-19 03:57:00                 63.8M    7.4M     19.80            -
> AAN  2012-03-19 04:01:00                1.980B  274.8M     18.32            -
> AAON 2012-03-19 04:00:00                510.3M   40.0M     26.43            -
> AAPL 2012-03-19 04:00:00                560.4B 45.452B     16.66            -
> AAP  2012-03-19 04:02:00                6.454B  841.7M     17.23            -
>     Short Ratio Book Value Earnings/Share Float Shares  NA  NA NA
> AA           3.1     12.955          0.550            1  65 286  0
> AACC        15.0      4.497          0.390           14 847   0 NA
> AAC         10.3      0.658         -0.043            4 771   0 NA
> AAME         0.3      4.277          0.150            6 956   0 NA
> AAN          4.2     12.910          1.430           68  60   0 NA
> AAON        34.4      5.081          0.767           18 590   0 NA
> AAPL         0.5     96.602         35.138          931 791   0 NA
> AAP          1.6     11.677          5.110           72 323   0 NA
>
> Besides, in the example above, why there're 3 columns named "NA" after the "Float Shares" which was the last attribute in my query?
>
> Can anyone help? Thanks!
>
> best regards,
> Xian
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.



More information about the R-SIG-Finance mailing list