Reordering of a Data Set in R Programming - arrange() Function Last Updated : 15 Jun, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report arrange() function in R Language is used for reordering of table rows with the help of column names as expression passed to the function. Syntax: arrange(x, expr) Parameters: x: data set to be reordered expr: logical expression with column name Example 1: Python3 1== # R program to reorder a data set # Loading library library(dplyr) # Calling dataset x <- BOD x # Calling arrange() function arrange(x, demand) Output: Time demand 1 1 8.3 2 2 10.3 3 3 19.0 4 4 16.0 5 5 15.6 6 7 19.8 Time demand 1 1 8.3 2 2 10.3 3 5 15.6 4 4 16.0 5 3 19.0 6 7 19.8 Example 2: Python3 1== # R program to reorder a data set # Loading library library(dplyr) # Create a data frame d <- data.frame( name = c("Abhi", "Bhavesh", "Chaman", "Dimri"), age = c(7, 5, 9, 16) ) # Arranging name according to the age d.name<- arrange(d, age) print(d.name) Output: name age 1 Bhavesh 5 2 Abhi 7 3 Chaman 9 4 Dimri 16 Comment More infoAdvertise with us Next Article Reordering of a Data Set in R Programming - arrange() Function N nidhi_biet Follow Improve Article Tags : R Language R DataFrame-Function Similar Reads Sorting of a Vector in R Programming - sort() Function In R Programming Language we can sort a vector in ascending or descending order using the sort() function. The sort() function returns a sorted version of the input vector. sort() function in is used to sort a vector by its values. It takes the Boolean value as an argument to sort in ascending or de 2 min read Sorting of Arrays in R Programming Prerequisite: R â Array A vector is a uni-dimensional array, which is specified by a single dimension, length. A Vector can be created using the âc()â function. A list of values is passed to the c() function to create a vector. Sorting can be done either in ascending order or descending. There are f 5 min read Convert an Unordered Factor to an Ordered Factor in R Programming - as.ordered() Function as.ordered() function in R Language takes an unordered factor as argument and converts it into an ordered factor. Syntax: as.ordered(factor) Parameters: factor: Unordered Factor to be converted Example 1: Python3 1== # Creating a vector x<-c("North", "North", "East", 1 min read Reassemble the Divided Data in R Programming - unsplit() function In R programming, data which is split by split() function can be reassembled back using unsplit() function. This function is reverse of split() function. In this article, we'll learn the syntax and implementation of unsplit() function with the help of examples. Syntax: unsplit(value, f, drop = FALSE 9 min read Convert an Object to Data Frame in R Programming - as.data.frame() Function as.data.frame() function in R Programming Language is used to convert an object to data frame. These objects can be Vectors, Lists, Matrices, and Factors. Syntax: as.data.frame(object) Parameters:Â object: Vector, Matrix, factor, or data frameR - as.data.frame() Function ExampleExample 1: Basic exam 2 min read Like