I am currently working in the quantmod package and wish to retrieve some financial statements. I am having an issue specifying what type of financial statement I want. By default it retrieves the Annual BS.
tickers <-new.env()
s <-c(list of tickers...)
lapply(s, getFinancials, env=tickers)
FS <-data.frame(lapply(tickers, viewFinancials)
When I do attempt to specify the FS, it gives me the error message of either saying 'x' must be type of financials or since I"m using lapply it won't recognize it as a function. I do like using lapply for this because it puts the financial statements in a data frame and in the exact format that I like, I just want to do it for the Annual IS.
Thank you!
This code works and not only includes the BS, but the IS and CF as well:
Input:
Output:
?viewFin
or?viewFinancials
would have shown you the possible options/arguments forviewFinancials
.