In this tutorial, we will learn how to sort columns of a dataframe in alphabetical order. We will first use tidyverse to sort columns of a dataframe using two different ways. And then we will see how to use base R functions to sort the columns. Let us load tidyverse. We will use starwars that… Continue reading How to sort columns alphabetically
Category: tidyverse
tidyverse all_of(): select columns from a vector
In this tutorial, we will learn about how to select multiple columns from a dataframe by using the column names as a vector at once. tidyverse’ tidyselect package has numerous options for selecting columns from a datafame. all_of() is one of the functions in tidyselect that helps us selecting multiple columns using a character vector.… Continue reading tidyverse all_of(): select columns from a vector
How to Replace NAs with Column mean using tidyverse
In this tutorial, we will learn how to replace missing values NAs in a data set with column means using tidyverse functions. Dealing with missing data is very important in doing data analysis. Understanding the origin of missing values NAs is very important to make a decision on what to do with them. In earlier… Continue reading How to Replace NAs with Column mean using tidyverse