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 […]
tidyverse 101
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 […]
14 Tips to Work with Dates in tidyverse
In this quick post we will see 14 simple tips that will help get started dealing with date as variable instead of a string. We will see tips on how to create a date variable in few different ways and get components of date variable using the R package lubdridate. The R package lubdridate was […]
6 Tips to change column positions with dplyr’s relocate()
Sometimes you want to change the order of columns in a dataframe. dpyr’s relocate() function makes it easy to move one or more columns to new positions easily by using the same syntax as select() function. In this post we will see 7 tips to change column order or column position using dplyr’s relocate(). Let […]