In this post, we will see 10 tips to annotate a plot with a title and to customize title text of a plot made with ggplot2. We will start with how to add title to a plot made with ggplot2 using two functions ggtitle() and labs(). And then we will learn how to use ggplot2’s […]
R Tips
PCA on S&P 500 Stock Return Data
This post is a fun exercise applying PCA (most in tidyverse framework) to stock data from S&P 500 index companies. With PCA on stock data from S&P 500, we can possibly do many interesting things, but we will focus on really simple things and try to see if PCA captures the general company trends from […]
Linear Regression with Matrix Decomposition Methods
Still remember the first time I learned we can perform linear regression using matrix decomposition techniques like QR decomposition. Totally mind blown. Clearly had no clue that was possible. This is a fun post on performing linear regression using QR decomposition, Cholesky decomposition and Singular Value Decomposition (SVD) using #rstats. No theory behind it, just […]
PCA in tidyverse framework
Performing PCA in tidyverse framework is probably one of my go to approaches for any high-dimensional data. In R, we can easily perform Principal Component analysis (PCA) using prcomp() and a few other options. A common challenge I face is to quickly look at the PCA results using a few different plots. With continual development […]
How to make a Calender in R with ggplot2
In this post, we will see how to make a calendar from scratch using R in ggplot2. I have been wanting to do this for a while. There is no better time to do this as we are at the end of the year 2022. The goal is to make a simple calender for the […]