VOOZH about

URL: https://www.geeksforgeeks.org/r-language/reordering-of-a-data-set-in-r-programming-arrange-function/

⇱ Reordering of a Data Set in R Programming - arrange() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Reordering of a Data Set in R Programming - arrange() Function

Last Updated : 15 Jul, 2025
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: 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: Output:
 name age
1 Bhavesh 5
2 Abhi 7
3 Chaman 9
4 Dimri 16
Comment
Article Tags:

Explore