Note that there are some explanatory texts on larger screens.

plurals
  1. POR quantmod:getFinancials
    primarykey
    data
    text
    <p>I'm trying to import the financials statements of all the companies listed on the NYSE whose market cap is in greater than the first quartile of the sample. Here is my code :</p> <pre><code>require(TTR) require(quantmod) data.init="2013/01/01" start.date &lt;- as.numeric(gsub("/", "",data.init)) nyse.symbols &lt;- stockSymbols("NYSE")[,-c(3,5)] nyse.symbols &lt;- na.omit(nyse.symbols[which(nyse.symbols[,"MarketCap"]&gt;0),]) ######## Selection Criteria # Filter 1 : stock mkt cap &gt; 1st quartile --&gt; remove the less liquid stocks mktcap.filter &lt;- quantile(nyse.symbols[,"MarketCap"],0.25) nyse.symbols &lt;- nyse.symbols[which(nyse.symbols[,"MarketCap"]&gt;mktcap.filter),] # Filter 2 : nyse.fs &lt;- new.env() tickers.fs &lt;- nyse.symbols[,1] tickers.fs &lt;- tickers.fs[- match(c("IHG","AF","BAP","BBD","BBDO"),tickers.fs)] lapply(tickers.fs, getFinancials,env=nyse.fs) </code></pre> <p>I've removed the following stocks <code>c("IHG","AF","BAP","BBD","BBDO")</code>because <code>quantmod</code>does not manage to import the financials statements: I've got an error message like that :</p> <pre><code>Error in thead[x]:thead[x + 1] : NA/NaN argument In addition: There were 39 warnings (use warnings() to see them) </code></pre> <p>and here is what I get when using the <code>warnings()</code> function:</p> <p>Warning messages (I've got 39 errors messages of this type):</p> <pre><code>1: In readLines(tmp) : incomplete final line found on '/var/folders/9q/pwdpb5nj7bb8jjc_kb3np__h0000gn/T//RtmpeUS9Uh/file7de4698fa5b' 2: In readLines(tmp) : incomplete final line found on '/var/folders/9q/pwdpb5nj7bb8jjc_kb3np__h0000gn/T//RtmpeUS9Uh/file7de655c9092' 3: In readLines(tmp) : incomplete final line found on '/var/folders/9q/pwdpb5nj7bb8jjc_kb3np__h0000gn/T//RtmpeUS9Uh/file7de2017953b' </code></pre> <p>I've found the problematic stocks step by step. What I would like to do is automatically get rid of all the stocks whose financials statements are not available. Any idea?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload