As part of understanding and fine tuning ggplot2’s theme elements, we will focus on the anatomy of line elements and see 15 tips to control them with ggplot2’s theme system. With ggplot2’s theme system we can control the “non-data” elements of a plot made with ggplot2. ggplot2’s theme system comes with multiple element_ functions, element_text() […]
tidyverse 101
10 Tips to Customize Text Color, Font, Size in ggplot2 with element_text()
ggplot2’s theme system give us a great control over how the “non-data” elements of a plot should look like. The theme system helps elevate the plot you make by making finer changes and make it easy to look better. ggplot2’s theme system comes with multiple element_ functions, element_text() element_line() element_rect() element_blank() And they help control […]
How To Categorize Multiple Numerical Columns in R
Recently I had to convert a numerical matrix into categorical ones based on some conditions. Obviously there are multiple ways to go about. One of the key functions to categorize a numerical vector in R is to use cut() function, that allows to specify the intervals to categorize a numerical variable. Till now I was […]
7 Tips to Add Columns to a DataFrame with add_column() in tidyverse
Often while doing data analysis, one might create a new column or multiple columns to an existing data frame. In this post we will learn how to add one or more columns to a dataframe in R. tibble package in tidyverse, has a lesser known, but powerful function add_column(). We will learn 6 tips to […]
4 Tidyverse Tips for Future Self: case_when(), fct_relevel(), fct_recode(), scale_fill_brewer()
Here are four tidyverse tips for future self. These four tips/functions from tidyverse suite are a few of really simple things that I need often, but I always have to google and often struggle to come up with the search phrase. The first tip is very simple and extremely useful function case_when() from dplyr package. […]