How to reorder rows of data frames and tibbles with the arrange function of the dplyr package in the R programming language. More details: https://statisticsglobe.com/r-arrange-function-dplyr-package
R code of this video:
##### Example data
data <- data.frame(x1 = 1:5, # Create example data
x2 = c(1, 2, 2, 1, 2),
x3 = c("B", "C", "E", "A", "D"))
data # Print data to RStudio console
##### Install & load dplyr
install.packages("dplyr") # Install dplyr package
library("dplyr") # Load dplyr package
##### Example 1
arrange(data, x2) # Arrange data by one column
##### Example 2
arrange(data, x2, x3) # Arrange data by multiple columns