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: tidyselect
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