sewardlee337/finreportr

Error Received in Certain Ticker Symbols

Closed this issue · 1 comments

When I try to run GetIncome("CAT", 2016)

I receive the following error: Error in filter_impl(.data, quo) : Result must have length 1855, not 0

Here is the output from sessionInfo()

R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] bindrcpp_0.2     xml2_1.2.0       curl_3.1         XBRL_0.99.18     finreportr_1.0.1

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.13     XML_3.98-1.9     dplyr_0.7.4      assertthat_0.2.0 R6_2.2.2         magrittr_1.5     httr_1.3.1       stringi_1.1.5   
 [9] rlang_0.1.4      tools_3.4.1      stringr_1.2.0    selectr_0.3-1    glue_1.2.0       yaml_2.1.14      compiler_3.4.1   pkgconfig_2.0.1 
[17] rvest_0.3.2      knitr_1.17       bindr_0.1        tibble_1.3.4 

I've tried successfully with a few other symbols (i.e., AAPL), but can't seem to get it to work consistently. Also, this is my first bug report, so please let me know if you need any other information.

Hi @ChiTownTimmy23,

Thank you for reporting this bug.

The reported problem (pertaining to example with company CAT) is now patched in the GitHub version of this package. To access this, please install using:

devtools::install_github("sewardlee337/finreportr")

What I am seeing after the patch is:

> head(GetIncome('CAT', 2016), 20)

                       Metric Units      Amount  startDate    endDate
1                Revenue, Net   usd 52694000000 2013-01-01 2013-12-31
2                Revenue, Net   usd 12493000000 2014-01-01 2014-03-31
3                Revenue, Net   usd 13391000000 2014-04-01 2014-06-30
4                Revenue, Net   usd 12758000000 2014-07-01 2014-09-30
5                Revenue, Net   usd 13500000000 2014-10-01 2014-12-31
6                Revenue, Net   usd 52142000000 2014-01-01 2014-12-31
7                Revenue, Net   usd 11961000000 2015-01-01 2015-03-31
8                Revenue, Net   usd 11583000000 2015-04-01 2015-06-30
9                Revenue, Net   usd 10285000000 2015-07-01 2015-09-30
10               Revenue, Net   usd 10318000000 2015-10-01 2015-12-31
11               Revenue, Net   usd 44147000000 2015-01-01 2015-12-31
12 Financial Services Revenue   usd  2962000000 2013-01-01 2013-12-31
13 Financial Services Revenue   usd   748000000 2014-01-01 2014-03-31
14 Financial Services Revenue   usd   759000000 2014-04-01 2014-06-30
15 Financial Services Revenue   usd   791000000 2014-07-01 2014-09-30
16 Financial Services Revenue   usd   744000000 2014-10-01 2014-12-31
17 Financial Services Revenue   usd  3042000000 2014-01-01 2014-12-31
18 Financial Services Revenue   usd   741000000 2015-01-01 2015-03-31
19 Financial Services Revenue   usd   734000000 2015-04-01 2015-06-30
20 Financial Services Revenue   usd   677000000 2015-07-01 2015-09-30
> head(GetBalanceSheet('CAT', 2016), 20)

                                                Metric Units      Amount startDate    endDate
1   Cash, Cash Equivalents, and Short-term Investments   usd  5490000000      <NA> 2012-12-31
2   Cash, Cash Equivalents, and Short-term Investments   usd  6081000000      <NA> 2013-12-31
3   Cash, Cash Equivalents, and Short-term Investments   usd  7341000000      <NA> 2014-12-31
4   Cash, Cash Equivalents, and Short-term Investments   usd  6460000000      <NA> 2015-12-31
5                    Accounts Receivable, Net, Current   usd  7737000000      <NA> 2014-12-31
6                    Accounts Receivable, Net, Current   usd  6695000000      <NA> 2015-12-31
7  Notes, Loans and Financing Receivable, Net, Current   usd  9027000000      <NA> 2014-12-31
8  Notes, Loans and Financing Receivable, Net, Current   usd  8991000000      <NA> 2015-12-31
9        Deferred and Refundable Income Taxes, Current   usd  1739000000      <NA> 2014-12-31
10       Deferred and Refundable Income Taxes, Current   usd  1526000000      <NA> 2015-12-31
11           Prepaid Expense and Other Assets, Current   usd   818000000      <NA> 2014-12-31
12           Prepaid Expense and Other Assets, Current   usd  1046000000      <NA> 2015-12-31
13                                      Inventory, Net   usd 12205000000      <NA> 2014-12-31
14                                      Inventory, Net   usd  9700000000      <NA> 2015-12-31
15                                     Assets, Current   usd 38867000000      <NA> 2014-12-31
16                                     Assets, Current   usd 34418000000      <NA> 2015-12-31
17                  Property, Plant and Equipment, Net   usd 16577000000      <NA> 2014-12-31
18                  Property, Plant and Equipment, Net   usd 16090000000      <NA> 2015-12-31
19                Accounts Receivable, Net, Noncurrent   usd  1364000000      <NA> 2014-12-31
20                Accounts Receivable, Net, Noncurrent   usd  1170000000      <NA> 2015-12-31
> head(GetCashFlow('CAT', 2016), 20)

1  Net Income (Loss), Including Portion Attributable to Noncontrolling Interest   usd  3803000000 2013-01-01 2013-12-31
2  Net Income (Loss), Including Portion Attributable to Noncontrolling Interest   usd  3711000000 2014-01-01 2014-12-31
3  Net Income (Loss), Including Portion Attributable to Noncontrolling Interest   usd  2113000000 2015-01-01 2015-12-31
4                                      Depreciation, Depletion and Amortization   usd  3087000000 2013-01-01 2013-12-31
5                                      Depreciation, Depletion and Amortization   usd  3163000000 2014-01-01 2014-12-31
6                                      Depreciation, Depletion and Amortization   usd  3046000000 2015-01-01 2015-12-31
7                                                     Goodwill, Impairment Loss   usd           0 2013-01-01 2013-12-31
8                                                     Goodwill, Impairment Loss   usd           0 2014-01-01 2014-12-31
9                                                     Goodwill, Impairment Loss   usd           0 2015-01-01 2015-12-31
10                                               Other Noncash Income (Expense)   usd  -482000000 2013-01-01 2013-12-31
11                                               Other Noncash Income (Expense)   usd  -553000000 2014-01-01 2014-12-31
12                                               Other Noncash Income (Expense)   usd  -508000000 2015-01-01 2015-12-31
13                                           Increase (Decrease) in Receivables   usd  -835000000 2013-01-01 2013-12-31
14                                           Increase (Decrease) in Receivables   usd  -163000000 2014-01-01 2014-12-31
15                                           Increase (Decrease) in Receivables   usd  -764000000 2015-01-01 2015-12-31
16                                           Increase (Decrease) in Inventories   usd -2658000000 2013-01-01 2013-12-31
17                                           Increase (Decrease) in Inventories   usd  -101000000 2014-01-01 2014-12-31
18                                           Increase (Decrease) in Inventories   usd -2274000000 2015-01-01 2015-12-31
19                                      Increase (Decrease) in Accounts Payable   usd   134000000 2013-01-01 2013-12-31
20                                      Increase (Decrease) in Accounts Payable   usd   222000000 2014-01-01 2014-12-31