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 […]
R Tips
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. […]
31 Days of #rstats Resources Advent
R community is amazing with sharing excellent learning resources for free. And it seems never ending!. If you are like me, you might have missed a lot of “#rstats resource advent” daily tweets containing fantastic R resources from RStudio’s Mara Averick (@dataandme). Not to worry, you have all the #rstats resource advent tweets from Day […]
9 Tips to Make Better Scatter Plots with ggplot2 in R
Scatter plot is one of the common data visualization method used to understand the relationship between two quantitative variables. When there is strong association between two variables you would easily see the relationship with scatterplot. However, when the relationship is subtle it may be tricky to see it. In this post we will see 9 […]
How To Change Legend Title in ggplot2?
In this post, we will see multiple examples of how to change the legend title in ggplot2. When you make a plot with ggplot2 and color/highlight data points by a variable in the input dataframe, ggplot2 uses the name of the variable present in the dataframe. However, sometimes you might want to change the legend […]