joshuaulrich / quantmod

Quantitative Financial Modelling Framework
http://www.quantmod.com/
GNU General Public License v3.0
798 stars 219 forks source link

getDividends throws an error: unable to find the function ".yahooURL" #364

Closed rpfreitasxyz closed 2 years ago

rpfreitasxyz commented 2 years ago

Description

Hello, all! Recently, getDividends() has been unable to find the function ".yahooURL()", throwing this error. Any tips?

Minimal, reproducible example

library(quantmod)
#> Carregando pacotes exigidos: xts
#> Carregando pacotes exigidos: zoo
#> Warning: package 'zoo' was built under R version 4.1.3
#> 
#> Attaching package: 'zoo'
#> The following objects are masked from 'package:base':
#> 
#>     as.Date, as.Date.numeric
#> Carregando pacotes exigidos: TTR
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo

getDividends("PETR3.SA")
#> Error in .yahooURL(Symbol.name, from.posix, to.posix, "1d", "div"): não foi possível encontrar a função ".yahooURL"

Session Info

sessionInfo()
#> R version 4.1.2 (2021-11-01)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 19043)
#> 
#> Matrix products: default
#> 
#> locale:
#> [1] LC_COLLATE=Portuguese_Brazil.1252  LC_CTYPE=Portuguese_Brazil.1252   
#> [3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C                      
#> [5] LC_TIME=Portuguese_Brazil.1252    
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] quantmod_0.4.20.1 TTR_0.24.3        xts_0.12.1        zoo_1.8-10       
#> 
#> loaded via a namespace (and not attached):
#>  [1] pillar_1.7.0      compiler_4.1.2    highr_0.9         R.methodsS3_1.8.1
#>  [5] R.utils_2.11.0    tools_4.1.2       digest_0.6.29     evaluate_0.15    
#>  [9] lifecycle_1.0.1   tibble_3.1.7      R.cache_0.15.0    lattice_0.20-45  
#> [13] pkgconfig_2.0.3   rlang_1.0.2       reprex_2.0.1      cli_3.3.0        
#> [17] rstudioapi_0.13   curl_4.3.2        yaml_2.3.5        xfun_0.31        
#> [21] fastmap_1.1.0     withr_2.5.0       styler_1.7.0      stringr_1.4.0    
#> [25] knitr_1.39        fs_1.5.2          vctrs_0.4.1       grid_4.1.2       
#> [29] glue_1.6.2        fansi_1.0.3       rmarkdown_2.14    purrr_0.3.4      
#> [33] magrittr_2.0.3    ellipsis_0.3.2    htmltools_0.5.2   utf8_1.2.2       
#> [37] stringi_1.7.6     crayon_1.5.1      R.oo_1.24.0
joshuaulrich commented 2 years ago

Thanks for the report! I'm aware of this and have started working on a fix. This has to do with switching to the JSON endpoint (#362) and removing the CSV endpoint for Yahoo Finance.

joshuaulrich commented 2 years ago

Fixed and merged!