[This article was first published on r on Everyday Is A School Day, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)Want to share your content on R-bloggers? click here if you have a blog, or here if you don't. Dipping my toes into financial statements — income, balance sheet & cash flow. Still don’t fully get it, but slowly piecing together the story these numbers tell. Warren Buffett makes it look easy Baby steps! Motivations I’ve always wanted to learn financial statement, what it means, what it tells us, what Warren Buffett sees in them. Following the book Warren Buffett and the Interpretation of Financial Statements: The Search for the Company with a Durable Competitive Advantage and Datacamp: Analyzing Financial Statement in Python, I’ve made some notes for myself and also create the metrics functions, so that I can use and view them easily in the future. I’ll be honest, I still don’t fully understand it, but at least I can refer back to this as I look at these statements more frequently.Disclaimer: This is purely for educational purposes. This is not a financial advice, nor am I a financial advisor. This is a note to myself. If you find any mistakes or error, please let me know. Thanks! Also, there are a lot of information on each section, I won’t be covering all of them, just mostly the metrics from the book and also points I found interesting.Objectives: The Skeleton of Financial StatementsLet’s Take An ExampleIncome StatementGross Profit MarginDepreciationInterest Payment to Operating IncomeIncome Before TaxIncome After TaxNet EarningsPer Share EarningOperating MarginMetricsBalance SheetCurrent AssetsNet Receivables To Gross Sale RatioThe Current RatioProperty, Plant, and EquipmentShort Term DebtLong Term DebtRetained EarningsTreasury StockReturn On Shareholders’ EquityMetricsCash FlowOperating IncomeCapital ExpenditureStock BuybackMetricsCombine All MetricsLet’s Look At Another ExamplesOppotunities For ImprovementLessons LearntThe Skeleton of Financial Statements A financial statement is a formal record that shows a company’s financial activities and position, typically consisting of three core components: the income statement (which shows revenues earned and expenses incurred to calculate profit or loss over a period), the balance sheet (which presents what the company owns as assets, what it owes as liabilities, and the difference between them as equity at a specific point in time), and the cash flow statement (which tracks the actual movement of cash in and out of the business through operating activities, investing activities, and financing activities). The income statement reveals profitability, and the cash flow statement shows liquidity and how money actually moves through the business.If we were to think of a kid’s lemonaid shop, the income statement would show how much money the shop made from selling lemon tea and how much it spent on ingredients, paying Johnny hourly to sell (salary) to calculate the profit. The balance sheet would list the shop’s assets (like cash in the register, inventory of lemons, sugar, and any equipment) and liabilities (like loans or unpaid bills – money your parent you borrowed from to buy all of the above) to show the net worth of the business at a given moment. The cash flow statement would track the actual cash coming in from customers and going out for expenses, giving insight into whether the shop has enough liquidity to cover its day-to-day operations.It sounds simple, in the big picture, but these are just the basic skeleton of financial statements. There are many nuances and details that we need to understand to really grasp the story that these statements are telling us.Each section has its own items and some of these items are good at forming different metrics to tell the story of how the lemonaid business is doing. Below is just a snapshot of Apple’s financial statement.Income Statement Balance Sheet Cash Flow Let’s Take An Example Let’s go to Alpha Vantage and create a free api key and then pull Apple’s 10 year financial statement and go through as an exercise.https://www.sec.gov/Archives/edgar/data/320193/000032019325000079/aapl-20250927.htm#i719388195b384d85a4e238ad88eba90a_181library(httr)library(jsonlite)library(tidyverse)api_key mutate(across(-c(fiscalDateEnding, reportedCurrency), as.numeric)) |> mutate(fiscalDateEnding = as.Date(fiscalDateEnding)) |> arrange(fiscalDateEnding) return(df)}## financial statementincome ggplot(aes(x = fiscalDateEnding, y = values)) + geom_rect( data = hline, aes(ymin = ymin, ymax = ymax, fill = color2), xmin = -Inf, xmax = Inf, alpha = 0.15, inherit.aes = FALSE ) + geom_line() + facet_wrap(. ~ param, scale = "free_y") + scale_fill_identity() + theme_bw() return(plot)}cashflow_metric(cashflow)Use key valuation metrics (P/E, EV/EBITDA, P/B, P/S, etc) to determine how cheap or expensive a stock is.Combine All Metrics codelibrary(httr)library(jsonlite)library(tidyverse)library(ggpubr)api_key mutate(fiscalDateEnding = ymd(fiscalDateEnding)) } else { df as_tibble() |> mutate(fiscalDateEnding = as.Date(fiscalDateEnding)) |> mutate(across(where(is.character), as.numeric)) |> arrange(fiscalDateEnding) } return(df)}income_metric mutate(param = factor(param, levels = columns)) |> ggplot(aes(x = fiscalDateEnding, y = values)) + geom_rect( data = hline, aes(ymin = ymin, ymax = ymax, fill = color2), xmin = -Inf, xmax = Inf, alpha = 0.15, inherit.aes = FALSE ) + geom_line() + facet_wrap(. ~ param, scale = "free_y") + scale_fill_identity() + theme_bw() + ggtitle("Income Statement Metrics") return(plot)}share_metric ggplot(aes(x = fiscalDateEnding, y = reportedEPS)) + geom_line() + geom_smooth() + theme_bw() + ggtitle("Share Metrics") return(plot)}balance_metric mutate(param = factor(param, levels = columns)) |> ggplot(aes(x = fiscalDateEnding, y = values)) + geom_rect( data = hline, aes(ymin = ymin, ymax = ymax, fill = color2), xmin = -Inf, xmax = Inf, alpha = 0.15, inherit.aes = FALSE ) + geom_line() + facet_wrap(. ~ param, scale = "free_y") + scale_fill_identity() + theme_bw() + ggtitle("Balance Sheet Metrics") return(plot)}cashflow_metric 0 ~ NA_real_, income$netIncome < 0 & proceedsFromRepurchaseOfEquity < 0 ~-proceedsFromRepurchaseOfEquity / income$netIncome)) hline mutate( param = factor(param), ymin = ifelse(color2 == "red", -Inf, hline_value), ymax = ifelse(color2 == "red", hline_value, Inf) ) columns pivot_longer(cols = c(operatingCashFlow, capitalExpenditureToNetEarning, stockBuybackToNetEarning), names_to = "param", values_to = "values") |> mutate(param = factor(param, levels = columns)) |> ggplot(aes(x = fiscalDateEnding, y = values)) + geom_rect( data = hline, aes(ymin = ymin, ymax = ymax, fill = color2), xmin = -Inf, xmax = Inf, alpha = 0.15, inherit.aes = FALSE ) + geom_line() + facet_wrap(. ~ param, scale = "free_y") + scale_fill_identity() + theme_bw() + ggtitle("Cash Flow Metrics") return(plot)}show_all