My code:
pacman::p_load("tidyverse","tidyquant")
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
'%&%' <- function(a,b) paste(a,b)
Stocks<-c("MSFT","IWDA.AS")
D <- tq_get(Stocks, get = "dividends", from = " 2010-01-01",complete_cases = TRUE)
The error:
Error in `dplyr::mutate()`:
ℹ In argument: `data.. = purrr::map(...)`.
Caused by error in `purrr::map()`:
ℹ In index: 2.
Caused by error in `dimnames<-.xts`:
! 'dimnames' applied to non-array
Run `rlang::last_trace()` to see where the error occurred.
The problem is that IWDA.AS has no dividend data and I get an error on that i guess. (I have actually a longer list of symbols with a few with symbols with no dividend data, not possible to eliminate them and here I give a reduced list.)
The same code worked fine 2 years ago, so I don't know what changed, something with tidyquant or yahoo finance?
Is there a quick fix for this?
(Same error occurs with 'get = "splits"'.)