In this tutorial we will learn how to compute product of all elements of a column in a dataframe using tidyverse. We will use prod() function in base to multiple all elements of a columns. Let us first load tidyverse. We will create a simple dataframe using tidyverse' … [Read more...] about How to get product of all elements in a column
slice_min: Get Rows with minimum values of a column
In this tutorial, we will learn how to get rows with lowest values of a column from a data frame in R. We will use dplyr's slice_min() function to select rows with lowest values for a column in a data frame. We will also use slice_min() function in dplyr to find the bottom n … [Read more...] about slice_min: Get Rows with minimum values of a column
Many linear regression models with tidyverse
In this tutorial, we will learn how to build many simple linear regression models in R using tidyverse. We will start with a simple approach that is not scalable to illustrate the challenges. Then we will show a naive approach using for loop to build many linear regression … [Read more...] about Many linear regression models with tidyverse
How to do inner join with dplyr in R
In this post, we will learn how to do an inner join in R with dplyr's inner_join(). An inner join between two dataframes x and y, gives is the only rows from x for which we have a matching key in y. First, load tidyverse suit of packages and check the version of dplyr … [Read more...] about How to do inner join with dplyr in R
Join dataframes by different column names with dplyr
In this tutorial, we will learn how to join dataframes by columns with different names in the two dataframes. dplyr offers a great set of tools to join or merge dataframes. We will use two approaches to merge two dataframe by different names. We will start with … [Read more...] about Join dataframes by different column names with dplyr