Ashutosh Agarwal Ashutosh Agarwal - 2 months ago 30
R Question

Refer individual tags in R Balance Sheet using Quantmod

I am working on analyzing Balance Sheets using R. I am using Quantmod for the same. Now I want to compare two individual rows in a balance sheet, say Cash and Equivalents and Accounts Receivable.

How do I refer these using Quantmod.


The above line displays the balance sheet. But how do I refer to individual rows.

Thanks in advance.


viewFin returns a list object, you can use rownames of the corresponding balance sheet object to subset your columns of interest

#List of 3


DF = AAPL.f$BS$A    #equivalent to above step

balanceSheet_Items = rownames(DF)

itemsOfInterest = c("Cash & Equivalents","Accounts Receivable - Trade, Net")

subsetDF = DF[balanceSheet_Items %in% itemsOfInterest,]
#                                 2016-09-24 2015-09-26 2014-09-27
#Cash & Equivalents                    11883       9731       3612
#Accounts Receivable - Trade, Net      15754      16849      17460
#                                 2013-09-28
#Cash & Equivalents                     5554
#Accounts Receivable - Trade, Net      13102